Repository navigation
fix: report the location from the presence message in location update events - #368
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
ttypic
approved these changes
Oct 6, 2026
ttypic
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for contribution!
This branch has not been deployed
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.
Description
Locations.processPresenceMessagebuilds eachupdateevent from the member returned byspace.members.getByConnectionId(). That member comes frompresence.get(), which holds the most recent presence state rather than the state at the time of the message being processed.When a member changes location quickly, the events for the earlier updates report the latest location as
currentLocation. For example, updates tolocation1and thenlocation2produce a first event withcurrentLocation: 'location2'andpreviousLocation: null, and a second event with the same current location.This change takes
currentLocation(and thelocationon the event'smember) from the presence message being processed.Testing
Locationstest where presence already holds the second location when the first update is processed. It expects each event to report its own location.prettier --checkandeslintare clean.Run with:
Fixes #367