This repository was archived by the owner on Nov 15, 2026. It is now read-only.
Repository navigation
fix(desktop): start the other reader at the unread view after a mode change - #78
Merged
Merged
Conversation
…change A Server sheet switch reloaded the window, and the reload kept the fragment. The window started at that route, so the other reader opened its own item with the same id and marked it read: item ids belong to one reader (plan 0002, Phase 10, item 7, on v0.6.0-rc.5). - A mode change loads the window's start address with no fragment. - A reload, or Back or Forward into an earlier document, starts at the unread view. - A document restored from the back-forward cache starts again. The unit tests switch readers with an item open, and the lodge e2e suite switches to lodge with a local item open and checks lodge's unread count. The plan records the rc.5 gate.
…g its route location.replace keeps the window's earlier history entries. After Back into an earlier document, the entries that document wrote are this document's too, and their routes can belong to the other reader. Each start now writes its own mark in the state of its entries, and Back or Forward to an entry without it goes to the unread view.
bketelsen
approved these changes
Nov 12, 2026
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the failure of item 7 ("Disconnects and mode changes") of the clean-install gate (plan 0002, Phase 10) on
v0.6.0-rc.5.A Server sheet switch reloaded the window (
web/src/desktop/server.ts:win.location.reload()), and the reload kept the URL fragment.web/src/desktop/start.tsxread the fragment as the start route, so with#/item/4open, the other reader opened its own item 4 and marked it read. Item ids belong to one reader: the item was unrelated data, in the local reader or in lodge's shared data.v0.6.0-rc.4has the same code; its gate run had no item open at a switch.The change:
tauriServer().reloadloads the window's start address with no fragment (startAddress,location.replace).startHash, from the navigation timing entry). This also covers the ErrorBoundary's reload and the unknown-mode check's reload.location.replacekeeps the window's earlier history entries, and after Back into an earlier document its entries are this document's too. Each start writes its own mark in the state of the entries it writes (newStart,startState), and Back or Forward to an entry without the mark goes to the unread view (ownsEntryinonPop).pageshowwithpersisted).localStorageorsessionStorageinweb/src)..memory/corrections.jsonlgets 1 line for the cross-review's blocking finding (the history entries), with its guard inweb/src/desktop.test.tsx.Docs: plan 0002 records the
v0.6.0-rc.5gate and this fix; Phase 10's Done when waits for a full gate onv0.6.0-rc.6.docs/design/overview.md,docs/specs/api.md(server_save) andAGENTS.mdStatus follow.Risk tier
Risk tier: 2 — behaviour change in the desktop window's start route. No path in
.github/risk-paths.jsonmatches (web/src/desktop/*is at the default level L3).Verification
make checkgreen (host)make web-checkgreen (nsl): 24 files, 182 testsmake app-checkandmake app-buildgreen (nsl)make app-e2e-lodgegreen (nsl), against lodgemain0e4a5bd and frostnotesmain: 7 of 7. Test b now opens a local item before the switch to lodge, and checks the window's fragment and lodge's unread total.make app-e2egreen (nsl) in 2 of 3 runs. The failed run:e2e/hostile.e2e.ts"runs nothing and reaches nothing through readd's sanitizer", WebDriverno such windowatcheckFrame's firstfind, the handle loss the suite documents after a history write. This change does not change how many history calls the shell makes.web/src/desktop.test.tsx"starts the other reader at the unread view and marks nothing read", withreloadback towin.location.reload(): fails withexpected [ { ids: [ 31 ], read: true } ] to deeply equal [], the gate's symptom.web/src/server-sheet.test.tsxfails too.reloadandback_forwardcases, with the start route back towin.location.hash: both fail with the sameitems.setReadcall.pageshowhandler emptied: fails.ownsEntrycheck bypassed: fails withexpected { kind: 'item', id: 31 } to deeply equal { kind: 'view', view: 'unread' }. With the shell writingnullstate, "moves between routes and back" and "follows Back to an entry that this start wrote" fail.make app-e2e-lodgewith both fixes reverted: test b fails withexpected [ '', '#/' ] to include '#/item/1'.