Skip to content

fix: drop phantom ended-tab stubs, trust server as source of truth#93

Merged
Ark0N merged 1 commit into
Ark0N:masterfrom
TeigenZhang:fix/drop-phantom-ended-tabs
May 19, 2026
Merged

fix: drop phantom ended-tab stubs, trust server as source of truth#93
Ark0N merged 1 commit into
Ark0N:masterfrom
TeigenZhang:fix/drop-phantom-ended-tabs

Conversation

@TeigenZhang
Copy link
Copy Markdown
Contributor

Summary

The client cached open session tabs in localStorage and resurrected any that the server no longer knew about as grayed-out "ended" stubs. On multi-device use (close tab on mobile, open desktop) this left stale phantom tabs the user had to manually dismiss every time.

Fix

Drop the client-side resurrection path entirely; let the server be the source of truth for which sessions are open.

Removed:

  • _restoreEndedTabs / _saveTabMetadata
  • The session._ended branch in selectSession
  • The data-ended render attribute and its matching CSS rule

Also clears the legacy localStorage key on init to purge stale entries left by previous client versions.

Net: -44 / +6 lines — removes complexity while fixing the UX bug.

Test plan

  • tsc --noEmit passes
  • npm run lint passes
  • npm run format:check passes
  • Manual verification: close a tab on mobile, refresh desktop — no phantom grayed-out tab appears.
  • Manual verification: existing legacy localStorage entries from older clients are cleared on next page load.

Previously the client cached open session tabs in localStorage and resurrected
any that the server no longer knew about as grayed-out "ended" stubs. On
multi-device use (close tab on mobile, open desktop) this left stale phantom
tabs the user had to manually dismiss.

Remove _restoreEndedTabs / _saveTabMetadata, the session._ended branch in
selectSession, the data-ended render attribute, and the matching CSS rule.
Clear the legacy localStorage key on init to purge stale entries.
@Ark0N
Copy link
Copy Markdown
Owner

Ark0N commented May 19, 2026

Great input — thank you! Clean removal: the localStorage resurrection was the only thing that set _ended: true on the client, so dropping it along with all the consumers is consistent. Server-side ended status (via .tab-status.ended) is preserved for sessions the server still knows about. Merging.

@Ark0N Ark0N merged commit e248cd8 into Ark0N:master May 19, 2026
1 check passed
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.

2 participants