fix: on() method now reads from correct subscription map for peerConnectionEvents#454
Merged
muke1908 merged 2 commits intoMay 19, 2026
Conversation
…ectionEvents - on() was always reading from this.subscriptions for duplicate check - even when listener belonged to callSubscriptions - this caused call event callbacks to never be deduplicated - changed this.subscriptions.get(listener) to subscriptions.get(listener) Fixes muke1908#453
There was a problem hiding this comment.
Pull request overview
Fixes a bug in ChatE2EE.on() where duplicate-listener checks for peerConnectionEvents were performed against the wrong subscription map, causing call event callbacks to not be deduplicated.
Changes:
- Update
on()to read the existing subscription set from the selectedsubscriptionsmap (eithersubscriptionsorcallSubscriptions) instead of always reading fromthis.subscriptions.
Comments suppressed due to low confidence (1)
service/src/sdk.ts:219
- Log message has a typo:
Skppingshould beSkipping(or similar) to avoid confusing/ungrep-able logs.
if (sub.has(callback)) {
loggerWithCount.log(`Skpping, subscription: ${listener}`);
return;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Fixes the bug reported in #453
Root Cause
The on() method in ChatE2EE was always reading from
this.subscriptions for the duplicate check, even when
the listener belonged to callSubscriptions.
Fix
Changed one line in service/src/sdk.ts:
// Before ❌
const sub = this.subscriptions.get(listener);
// After ✅
const sub = subscriptions.get(listener);
Testing
All existing 75 tests pass with no failures.
Fixes #453