fix(fdc3) - AddContextListener fix if the channel has not been set #779
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fdc3.addContextListener should work when the channel has not been set as well. When using the
fdc3.addContextListener
the contextListeners should be cached so if the desktopagent joins to a user channel then those contextlisteners should be added to that channel. When leaving the channel these contextlisteners should be no op.Changes:
The context listeners added through the
fdc3.addContextListener
are cached and readded(subscribed) when joining the channelNot throwing exception if the listeners are added when the desktop agent is not joined to the channel
When leaving the channel we are unsubscribing from the topic.
Caching all the context listeners(user/private/app) on the backend when we call the
subscribe
method of the ComposeUIContextListener in typescript.Removing the ContextListeners from the backend when we call the
unsubscribe
method of the ComposeUIContextListener -> returning Promise is necessary to call the messagerouter's invoke method.