Skip to content

Commit 4e236dd

Browse files
committed
feat(sdk): stop bypassing UserPresence:* methods — let them hit DDPSDK
The original bypass for UserPresence:setDefaultStatus / online / away was a performance guard: REST round-trips were expensive for the frequent heartbeat-style calls, so they stayed on the Meteor DDP WS. With the DDPSDK WebSocket now carrying the rest of the RPC traffic, that rationale no longer applies — they can ride the same socket as every other sdk.call. logout and setUserStatus stay on the bypass list for now. logout mutates per-connection auth state that the Accounts.onLogout chain relies on, and setUserStatus currently feeds the legacy Meteor user stream.
1 parent caa949e commit 4e236dd

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/meteor/client/meteor/overrides/ddpOverREST.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ const shouldBypass = ({ msg, method, params }: Meteor.IDDPMessage): boolean => {
1616
return true;
1717
}
1818

19-
if (method.startsWith('UserPresence:') || bypassMethods.includes(method)) {
19+
// `logout` mutates per-connection auth state on Meteor's side; keeping it on
20+
// Meteor.connection ensures the subsequent Accounts.onLogout chain (userId
21+
// cleanup, ServerContext status flip, etc.) fires as before.
22+
// `setUserStatus` toggles `_updatedAt` and presence fields that the Meteor
23+
// user stream is still expected to drive while it remains the auth anchor.
24+
if (bypassMethods.includes(method)) {
2025
return true;
2126
}
2227

0 commit comments

Comments
 (0)