Repository navigation
fix: replace presence users on resubscription - #383
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
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.
Fixes #299
Presence channels are reused when reconnecting, but subscription snapshots were added to the existing user map. Users who left during a disconnect therefore remained in
getUsers()andonUsersInformationReceived.Clear the previous membership before applying a successful presence snapshot. The existing missing-presence error path remains unchanged.
Two regression tests send successive subscription snapshots, covering a departed user and an empty replacement snapshot. Both check the stored membership and the users-information callback.
Testing and validation
The two new tests fail on
master(expected:<1> but was:<2>andexpected:<0> but was:<2>) and pass with the fix. With the patch,gradle testpasses the full suite (325 tests) on Gradle 7.3 and JDK 17 in Docker. The 8 and 11 CI jobs were not run locally. The scenario was exercised through successive subscription events in unit tests, not against a live Pusher app.This patch and its regression tests were prepared and tested with AI coding agents.