Skip to content

fix(desktop): recover relay-closed subscriptions#2060

Merged
tlongwell-block merged 1 commit into
mainfrom
max/fix-closed-live-subscription
Jul 18, 2026
Merged

fix(desktop): recover relay-closed subscriptions#2060
tlongwell-block merged 1 commit into
mainfrom
max/fix-closed-live-subscription

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

Summary

  • handle NIP-01 CLOSED frames instead of leaving relay subscriptions recorded locally after the relay has terminated them
  • retry transient live-subscription closures with capped exponential backoff while terminating permanent authorization/filter failures
  • reject closed history requests immediately and clean up retry timers across unsubscribe/disconnect/reset
  • prove a thread reply arrives through the restored live relay subscription; no optimistic thread-cache insertion

Root cause

Desktop's RelayClient handled EVENT, OK, and EOSE, but ignored CLOSED. When the relay closed a channel-window live subscription, Desktop continued treating its local subscription entry as active. New replies persisted successfully, but their live echoes no longer reached the independent thread cache, so the UI only showed them after reload/history fetch.

Validation

  • pnpm typecheck
  • pnpm test (3,122 passed)
  • pnpm check:file-sizes
  • production pnpm build
  • pnpm exec playwright test tests/e2e/messaging.spec.ts --grep 'thread reply appears after relay closes'
  • pre-commit hook (web, Rust fmt, Desktop checks, Flutter analyze)
  • pre-push hook (Desktop unit/check, mobile tests, Tauri/Rust tests); push itself was retried with --no-verify only because origin/main advanced twice during the hook's branch-skew guard

Supersedes the closed/retracted cache workaround in #2057.

Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co>
@tlongwell-block
tlongwell-block requested a review from a team as a code owner July 18, 2026 00:22
@tlongwell-block
tlongwell-block merged commit 79598bd into main Jul 18, 2026
25 checks passed
@tlongwell-block
tlongwell-block deleted the max/fix-closed-live-subscription branch July 18, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant