fix: message proxy support multiple subscribers #2392
Merged
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.
What does this PR do?
Resolving the following todo
podman-desktop-extension-ai-lab/packages/shared/src/messages/MessageProxy.ts
Line 223 in 4fa1055
When creating a store we can provide a list of events
podman-desktop-extension-ai-lab/packages/frontend/src/stores/localRepositories.ts
Line 9 in 40d97c3
The
RPCReadable
implemention will subscribe to the MessageProxy using the provided channel.What happen if two store try to subscribe to the same event ? Only the last one is kept.
podman-desktop-extension-ai-lab/packages/shared/src/messages/MessageProxy.ts
Line 213 in 40d97c3
This PR change it by having a
Set
instead to be able to manage several listeners.Screenshot / video of UI
What issues does this PR fix or reference?
Found this problem while working on #1851
How to test this PR?