fix(status): any Lotus device clears an auto-expiring status, not just the one that set it (#300) #394

Open
jared wants to merge 1 commits from fix/status-expiry-account-data into lotus
Owner

Fixes #300.

"Auto-clear after 1 hour" stored the expiry only in the setting device's localStorage. A status like "🍔 Lunch" set on a laptop that was then closed stayed on the server (presence.status_msg) until that laptop opened Lotus again. Other devices adopt the server status but never knew when it expired.

Change

  • New account data io.lotus.status_expiry, holding { status_msg, expires_at }. Profile writes it with the status (save, presets) and removes it on Clear or a status without expiry. The local key stays as before.
  • StatusExpiryMonitor on every device also checks the shared expiry:
    • when it's due and the server status is still that message, it clears the status (same retrying write as before);
    • if the status has changed meanwhile, it just forgets the expiry.

Verified (local Synapse): a status plus a 10 s expiry set by "device A" through the API, then only device B opened. Before expiry the status is "🍔 Lunch 336". About 30 s later it is "", and the expiry record is {}.

Unit tests for parsing and the clear / forget decision. tsc clean · unit tests pass · ESLint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #300. "Auto-clear after 1 hour" stored the expiry only in the setting device's localStorage. A status like "🍔 Lunch" set on a laptop that was then closed stayed on the server (`presence.status_msg`) until that laptop opened Lotus again. Other devices adopt the server status but never knew when it expired. **Change** - New account data `io.lotus.status_expiry`, holding `{ status_msg, expires_at }`. Profile writes it with the status (save, presets) and removes it on Clear or a status without expiry. The local key stays as before. - `StatusExpiryMonitor` on every device also checks the shared expiry: - when it's due and the server status is still that message, it clears the status (same retrying write as before); - if the status has changed meanwhile, it just forgets the expiry. **Verified** (local Synapse): a status plus a 10 s expiry set by "device A" through the API, then only device B opened. Before expiry the status is `"🍔 Lunch 336"`. About 30 s later it is **`""`**, and the expiry record is `{}`. Unit tests for parsing and the clear / forget decision. `tsc` clean · unit tests pass · ESLint clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-17 20:37:27 -04:00
fix(status): any Lotus device clears an auto-expiring status, not just the one that set it (#300)
CI / Build & Quality Checks (pull_request) Successful in 3m2s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 9s
CI / Playwright smoke (e2e) (pull_request) Successful in 25m12s
c8576cbb1f
"Clear after 1 hour" lived in that device's localStorage, so a status
set on a laptop that was then closed stayed on the server until the
laptop opened Lotus again. The expiry is now also kept in account data
(io.lotus.status_expiry: { status_msg, expires_at }). Every device's
StatusExpiryMonitor clears the status when due, but only if it is still
the one that was set to expire (otherwise it just forgets the expiry).

Fixes #300

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
All checks were successful
CI / Build & Quality Checks (pull_request) Successful in 3m2s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 9s
CI / Playwright smoke (e2e) (pull_request) Successful in 25m12s
This pull request has changes conflicting with the target branch.
  • src/app/pages/client/ClientNonUIFeatures.tsx
  • src/types/matrix/accountData.ts
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/status-expiry-account-data:fix/status-expiry-account-data
git checkout fix/status-expiry-account-data
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#394