Make the e2e suite pass, and fix the data loss it was reporting - #106
Merged
Merged
Conversation
Closing fires the title, the source and the content commits and closes in the same turn, so they are still suspended on the draft's resolution when the overlay goes. The draft was gone by then and a closed editor adopts nothing, leaving find() with only the canvas view — a round trip behind — so the commits resolved to nothing and were dropped. The note kept the title its creation payload carried and lost the body typed after it. The store now remembers the row the draft became until the editor is pointed elsewhere. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tauri-plugin-window-state writes .window-state.json under app_config_dir(), which on Linux is not app_data_dir() — so the window geometry survived the wipe and a run opened on the window the previous one closed with. Windows cannot tell the two directories apart, which is why it passed there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The variables panel commits on blur and the write crosses the bridge, so the sleep was a bet. A Windows runner lost it: the note was re-read before the variable existed and reported the snippet's own default, and the scenario after it then found no row to remove. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two commits, one subject: the end-to-end suite fails on the Ubuntu leg, and it is
right to.
1 — A note closed right after it was written loses its body
Not flaky infrastructure.
requestClose()fires the title, the source and thecontent commits and then closes, in the same turn. Each commit suspends on
resolve()while the draft turns into a row;closeOverlay()runs before theyresume and clears
_selectedNote.By the time they do resume,
find()has nothing left to answer with: the draftis gone, the selection is gone, and the only fallback is the canvas view —
which is one round trip behind the write that created the note. The commits
resolved to
nulland were dropped in silence. The note kept the title itscreation payload carried and lost the body typed after it.
Windows wins that race, Linux loses it, which is what made a data-loss bug read
as an unreliable test.
NotesStorenow remembers the row the draft became, until the editor is pointedat another note.
find()consults it after the selection and before the view,and
persist()keeps it current.Reproduced, not guessed. The new test plays that sequence — commit, close in
the same turn, let it settle. With the lookup removed:
2 — The e2e profile was only half wiped
resetProfile()wipedapp_data_dir()and called it clean. Since #99 that is nolonger the whole profile:
tauri-plugin-window-statewrites.window-state.jsonunder
app_config_dir(), and on Linux those are two different directories.So the window geometry survived every wipe there, and a run opened on the window
the run before it closed with. Windows cannot tell the two apart — both are
%APPDATA%\<id>— which is why the hole never showed, and CI never met it either:its runners are new each time. Both are wiped now, de-duplicated so Windows still
does one pass, and the guard names whichever survived.
docs/architecture.mdsaysso where it states the rule.
Checked
npm test960 passing,npm run lintclean, the suite 15/15 in 3:52 locally.On CI the first three attempts of the earlier commit were green on both legs;
the count restarts here because this branch moved, and five consecutive green runs
are what this merges on.
test-e2eiscontinue-on-error, so afailing E2E leg still reports the whole run as
success— which is how the defectabove sat on
mainacross three merges. #108 tracks that.🤖 Generated with Claude Code