fix(presence): Invisible, Hide Online Status, Idle and DND stick (#282) #354

Merged
jared merged 1 commits from fix/presence-sticky into lotus 2026-10-12 12:53:56 -04:00
Owner

Fixes #282.

usePresenceUpdater sent a one-off PUT /presence. Meanwhile the SDK kept long-polling /sync with the default set_presence=online, and Synapse treats every sync as "online". So Invisible, Hide Online Status, Idle and DND flipped back to online within seconds: a privacy setting that silently didn't work.

Change: the presence helpers also call mx.setSyncPresence(), the way Element keeps a manual state:

  • offline for Invisible and Hide Online Status;
  • unavailable for Idle and DND (and for auto-mode idle or a hidden tab);
  • online otherwise.

The PUT stays for the immediate change.

Verified on the local Synapse. In each mode, after a reload, another account polled GET /presence every 5 s for 60 s:

mode before after (12 samples) /sync set_presence
Invisible online* ×8 offline ×12 offline
Hide Online Status online* offline ×12 offline
Idle online unavailable ×12 unavailable
DND online unavailable ×12 unavailable
Online online* online* ×12 online

(* = currently_active)

tsc clean · unit tests pass · ESLint/Prettier clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #282. `usePresenceUpdater` sent a one-off `PUT /presence`. Meanwhile the SDK kept long-polling `/sync` with the default `set_presence=online`, and Synapse treats every sync as "online". So **Invisible**, **Hide Online Status**, **Idle** and **DND** flipped back to online within seconds: a privacy setting that silently didn't work. **Change:** the presence helpers also call `mx.setSyncPresence()`, the way Element keeps a manual state: - `offline` for Invisible and Hide Online Status; - `unavailable` for Idle and DND (and for auto-mode idle or a hidden tab); - `online` otherwise. The PUT stays for the immediate change. **Verified** on the local Synapse. In each mode, after a reload, another account polled `GET /presence` every 5 s for 60 s: | mode | before | after (12 samples) | `/sync` set_presence | |---|---|---|---| | Invisible | online* ×8 | **offline** ×12 | offline | | Hide Online Status | online* | **offline** ×12 | offline | | Idle | online | **unavailable** ×12 | unavailable | | DND | online | **unavailable** ×12 | unavailable | | Online | online* | online* ×12 | online | (* = currently_active) `tsc` clean · unit tests pass · ESLint/Prettier clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-12 12:35:30 -04:00
fix(presence): Invisible, Hide Online Status, Idle and DND stick (#282)
CI / Build & Quality Checks (pull_request) Successful in 3m49s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 10s
CI / Playwright smoke (e2e) (pull_request) Successful in 13m50s
9b2ec91dd6
usePresenceUpdater sent a one-off PUT /presence, but the SDK kept
long-polling /sync with the default set_presence=online and Synapse treats
every sync as "online", so Invisible / Hide Online Status / Idle / DND
flipped back within seconds — a privacy setting that silently didn't work.

The presence helpers now also call mx.setSyncPresence(): offline for
Invisible / Hide Online Status, unavailable for Idle / DND (and auto-mode
idle / hidden tab), online otherwise. The PUT stays for the immediate
change.

Verified on the local Synapse, another account polling every 5 s for 60 s
after a reload in each mode: invisible → offline ×12, hidePresence →
offline ×12, idle → unavailable ×12, dnd → unavailable ×12, online →
online (currently_active) ×12; /sync carries set_presence=offline /
unavailable / online accordingly (before: online* throughout).

Fixes #282

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit 1f10866b60 into lotus 2026-10-12 12:53:56 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#354