Skip to content

Keep a request database written by a newer version - #280

Merged
fylorn merged 1 commit into
mainfrom
fix/keep-newer-request-db
Oct 3, 2026
Merged

fylorn merged 1 commit into
mainfrom
fix/keep-newer-request-db

Conversation

@fylorn

@fylorn fylorn commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Why

tw_store::open rebuilt the request database (bodies included) whenever its schema version differed from this build's, in either direction. An older twcore opening a database written by a newer one therefore wiped history that the newer version would have read again. That happens when an older release is installed over a newer one. It will also happen when a second desktop copy on the same machine has not updated yet. The Lite Windows portable build makes the second case more likely.

What

  • Only an older database is rebuilt, as before.
  • A newer database is left untouched: open returns OtherVersion. build_store already turns that into "nothing is recorded this run, forwarding is unaffected", and /storage reports recording: false. The newer version later opens it unchanged.
  • Test: a newer database keeps its rows, its user_version and its bodies. The existing rebuild test is renamed to say "older".

No protocol, config or message-code change.

🤖 Generated with Claude Code

tw_store::open rebuilt the request database, bodies included, whenever
its schema version differed from this build's, in either direction. An
older twcore opening a newer database therefore wiped the history the
newer version would read again: installing an older release over a
newer one, or a second desktop copy on the same machine that has not
updated yet.

Only an older database is rebuilt now. A newer one is left as it is and
open returns OtherVersion, so this run records nothing (the existing
"recording: false" path) and forwarding is unaffected; the newer version
reads it again unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 649759b into main Oct 3, 2026
4 checks passed
@fylorn
fylorn deleted the fix/keep-newer-request-db branch October 3, 2026 14:19
@fylorn fylorn mentioned this pull request Oct 3, 2026
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