-
Notifications
You must be signed in to change notification settings - Fork 12.6k
fix(presence): update connections on heartbeat and remove them when stale #37551
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
Open
cardoso
wants to merge
43
commits into
develop
Choose a base branch
from
fix/presence-dangling
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+480
−4
Open
Changes from 39 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
222943a
fix: d
cardoso b2818bd
fix: renew with ddp over rest
cardoso 2c79e92
chore: improve types
cardoso cb85c50
refactor: take userId in renewConnection
cardoso 818db84
fix: remove expired connections on renew
cardoso bcda88d
refactor: simplify logic & separate tests
cardoso 926642b
chore: add changeset
cardoso d75b0cf
Merge branch 'develop' into fix/presence-dangling
cardoso b03787e
Merge branch 'develop' into fix/presence-dangling
cardoso a7f2be2
Merge branch 'develop' into fix/presence-dangling
cardoso 6bde2cf
refactor: remove UserPresence:ping
cardoso d04d556
Merge branch 'develop' into fix/presence-dangling
cardoso d842b11
fix: meteor types
cardoso 992a691
chore: updateConnectionStatus throttle
cardoso e542ec5
Merge branch 'develop' into fix/presence-dangling
cardoso 7f7a552
Merge branch 'develop' into fix/presence-dangling
cardoso 1e7a950
Merge branch 'develop' into fix/presence-dangling
cardoso 62d2466
Merge branch 'develop' into fix/presence-dangling
cardoso e1a7a4f
Merge branch 'develop' into fix/presence-dangling
cardoso d56714a
Merge branch 'develop' into fix/presence-dangling
cardoso 7d3d039
chore: normalize monolith & microservice behavior
cardoso 2e3592d
Merge branch 'develop' into fix/presence-dangling
cardoso 628b508
fix: clean up throttle tracking for connections
cardoso 1688b9c
Merge branch 'develop' into fix/presence-dangling
cardoso 049ef81
Merge branch 'develop' into fix/presence-dangling
cardoso bcf2d04
Merge branch 'develop' into fix/presence-dangling
cardoso a65f79b
fix: periodically remove stale connections
cardoso 682230a
Merge branch 'develop' into fix/presence-dangling
cardoso efff1b3
Merge branch 'develop' into fix/presence-dangling
cardoso 60f6657
Merge branch 'develop' into fix/presence-dangling
cardoso 3f106f3
refactor: move throttling logic to presence service
cardoso 8db5df2
refactor: separate cleaning logic into its own class
cardoso 5112f8a
fix: only update connection if no packet was seen
cardoso e7dbb88
Merge branch 'develop' into fix/presence-dangling
cardoso 0ab1249
Merge branch 'develop' into fix/presence-dangling
cardoso ff983de
chore: remove comments & unused properties
cardoso 1675085
Merge branch 'develop' into fix/presence-dangling
cardoso 96b25ce
improve: presence reaper robustness and connection updates
cardoso 3b0c9d0
fix(ddp-streamer): only update connection on heartbeat
cardoso 964f024
Merge branch 'develop' into fix/presence-dangling
cardoso 2926cfe
Merge branch 'develop' into fix/presence-dangling
cardoso 5633225
chore: remove test code
cardoso d3b27fb
Merge branch 'develop' into fix/presence-dangling
cardoso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| "@rocket.chat/meteor": patch | ||
| "@rocket.chat/core-services": patch | ||
| "@rocket.chat/model-typings": patch | ||
| "@rocket.chat/models": patch | ||
| "@rocket.chat/ddp-streamer": patch | ||
| "@rocket.chat/presence": patch | ||
| --- | ||
|
|
||
| Fixes user status inaccuracy by refreshing active connections and filtering out the stale ones. |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test-specific logic in production code path.
The hardcoded check for
'rocketchat.internal.admin.test'is a test-specific workaround in the production code path. This violates separation of concerns and could cause confusion or unintended behavior if this user ID appears in production.Consider one of these alternatives:
removeConnectionmethod entirely in tests rather than relying on special-case logic in the implementationasync removeConnection(uid: string | undefined, session: string | undefined): Promise<{ uid: string; session: string } | undefined> { - if (uid === 'rocketchat.internal.admin.test') { - console.log('Admin detected, skipping removal of connection for testing purposes.'); - return; - } if (!uid || !session) { return; }📝 Committable suggestion
🤖 Prompt for AI Agents