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: cached plugin events respect the specified client id #2806

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mfasold
Copy link

@mfasold mfasold commented Sep 22, 2023

Background: While experimenting with custom events, I found that some of the events that targeted a specific plugin instance were instead sent to all plugin instances. It turned out that events are cached until a plugin is loaded. But while all un-cached events are sent to the client that is specified in PluginInstruction::Update, this is not the case for cached events.

I also found that this applies not only to my experimental events. Also, some standard events (e.g. TabUpdate) with specified client ids are among the cached events. So I suspect this fix might not only benefit future events, but also makes current cached events more specific.

Description of the changes: WasmBridge::cached_events_for_pending_plugins now includes the Option<ClientId> specified in PluginInstruction::Update. The function apply_cached_events will respect these client ids, if provided.

I consider this a small fix, so no separate issue has been opened.

All normal tests run fine. Unfortunately I was not able to get the E2E tests running on my Mac, so I could only do some manual tests.

@imsnif imsnif self-assigned this Sep 22, 2023
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.

2 participants