Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fdc3) - AddContextListener fix if the channel has not been set #779

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

lilla28
Copy link
Contributor

@lilla28 lilla28 commented Sep 10, 2024

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 channel
Not 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.

@lilla28 lilla28 requested a review from a team as a code owner September 10, 2024 10:47
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 73.87755% with 64 lines in your changes missing coverage. Please review.

Project coverage is 68.86%. Comparing base (9ca098c) to head (3f0e4f3).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...dc3/src/infrastructure/ComposeUIContextListener.ts 48.27% 29 Missing and 1 partial ⚠️
...Stanley.ComposeUI.DesktopAgent/Fdc3DesktopAgent.cs 81.81% 7 Missing and 3 partials ⚠️
.../src/infrastructure/MessageRouterChannelFactory.ts 42.85% 8 Missing ⚠️
...dc3/js/composeui-fdc3/src/ComposeUIDesktopAgent.ts 73.07% 7 Missing ⚠️
...cture/messages/Fdc3RemoveContextListenerRequest.ts 63.15% 7 Missing ⚠️
...omposeui-fdc3/src/infrastructure/ComposeUITopic.ts 80.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #779      +/-   ##
==========================================
+ Coverage   68.53%   68.86%   +0.32%     
==========================================
  Files         293      300       +7     
  Lines        8667     8871     +204     
  Branches     1004     1016      +12     
==========================================
+ Hits         5940     6109     +169     
- Misses       2510     2542      +32     
- Partials      217      220       +3     
Files with missing lines Coverage Δ
...esktopAgent/Contracts/AddContextListenerRequest.cs 100.00% <100.00%> (ø)
...sktopAgent/Contracts/AddContextListenerResponse.cs 100.00% <100.00%> (ø)
...topAgent/Contracts/RemoveContextListenerRequest.cs 100.00% <100.00%> (ø)
...opAgent/Contracts/RemoveContextListenerResponse.cs 100.00% <100.00%> (ø)
.../MorganStanley.ComposeUI.DesktopAgent/Fdc3Topic.cs 88.88% <100.00%> (+0.65%) ⬆️
...opAgent/Infrastructure/Internal/ContextListener.cs 100.00% <100.00%> (ø)
...e/Internal/Fdc3DesktopAgentMessageRouterService.cs 88.02% <100.00%> (+0.71%) ⬆️
...poseui-fdc3/src/infrastructure/ComposeUIChannel.ts 96.51% <100.00%> (+0.08%) ⬆️
...mposeui-fdc3/src/infrastructure/ComposeUIErrors.ts 100.00% <100.00%> (ø)
...tructure/messages/Fdc3AddContextListenerRequest.ts 100.00% <100.00%> (ø)
... and 6 more

... and 6 files with indirect coverage changes

kruplm
kruplm previously approved these changes Sep 11, 2024
@lilla28 lilla28 force-pushed the fix/fdc3-addContextListener branch from 691e84a to 3f0e4f3 Compare September 11, 2024 08:46
@lilla28 lilla28 marked this pull request as draft September 11, 2024 13:04
@lilla28 lilla28 marked this pull request as ready for review September 11, 2024 13:21
@kruplm kruplm merged commit 26933d3 into morganstanley:main Sep 12, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants