fix(presence): leaving Do Not Disturb restores your status instead of "dnd" (#283) #355

Merged
jared merged 1 commits from fix/dnd-restore-status into lotus 2026-10-12 13:12:51 -04:00
Owner

Refs #283. Stacked on #354: merge that first, and its commit then drops out of this diff.

Lotus encodes Do Not Disturb as status_msg: "dnd". After switching back to Auto, the heartbeat read the server's status, adopted "dnd" as the user's own and kept re-sending it. The custom status was lost, other clients kept showing "dnd", and the Settings status field showed "dnd" too.

Change

  • pickHeartbeatStatus (new unit test) never adopts the "dnd" sentinel; it falls back to the device's real status.
  • Profile neither mirrors "dnd" into the local status nor shows it in the field.

Verified on the local Synapse: "🎮 Gaming" → DND (unavailable/dnd) → Auto → online/"🎮 Gaming". Before this, it ended as online/dnd.

Still open in #283: while you're in DND, other clients show the literal "dnd". Fixing that needs MSC3026 busy presence on the homeserver (matrix#19), so #283 stays open.

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

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Refs #283. **Stacked on #354**: merge that first, and its commit then drops out of this diff. Lotus encodes Do Not Disturb as `status_msg: "dnd"`. After switching back to Auto, the heartbeat read the server's status, adopted `"dnd"` as the user's own and kept re-sending it. The custom status was lost, other clients kept showing "dnd", and the Settings status field showed "dnd" too. **Change** - `pickHeartbeatStatus` (new unit test) never adopts the `"dnd"` sentinel; it falls back to the device's real status. - `Profile` neither mirrors `"dnd"` into the local status nor shows it in the field. **Verified** on the local Synapse: "🎮 Gaming" → DND (`unavailable`/`dnd`) → Auto → `online`/**"🎮 Gaming"**. Before this, it ended as `online`/`dnd`. **Still open in #283:** while you're in DND, other clients show the literal "dnd". Fixing that needs MSC3026 busy presence on the homeserver (matrix#19), so #283 stays open. `tsc` clean · unit tests 1334 pass · ESLint/Prettier clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 2 commits 2026-10-12 12:39:55 -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
fix(presence): leaving Do Not Disturb restores your status instead of "dnd" (#283)
CI / Build & Quality Checks (pull_request) Successful in 3m9s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 7s
CI / Playwright smoke (e2e) (pull_request) Successful in 12m36s
d9c797f3f5
Lotus encodes DND as status_msg "dnd". After switching back to Auto, the
heartbeat read the server's status, adopted "dnd" as the user's own and
kept re-sending it, so the custom status was lost and other clients kept
showing "dnd"; the Settings status field showed "dnd" too.

pickHeartbeatStatus (unit-tested) never adopts the "dnd" sentinel and
falls back to the device's real status; Profile neither mirrors it into
the local status nor shows it in the field.

Verified on the local Synapse: "🎮 Gaming" → DND (unavailable/dnd) → Auto
→ online/"🎮 Gaming" (before: online/"dnd").

Still open in #283: while in DND other clients show the literal "dnd";
that needs MSC3026 busy presence on the homeserver (matrix#19).

Refs #283

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit e57af60466 into lotus 2026-10-12 13:12:51 -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#355