Skip to content

ZenNotes 2.89.0: a stopped themes watcher drops reports still in flight - #1098

Merged
adibhanna merged 1 commit into
mainfrom
v2.89.0
Nov 20, 2026
Merged

adibhanna merged 1 commit into
mainfrom
v2.89.0

Conversation

@adibhanna

Copy link
Copy Markdown
Contributor

Main's CI for the 2.89.0 release commit (40976f2, PR #1097) failed one job, Build (ubuntu-24.04-arm): the new custom-themes watcher test saw a report 450 ms after the stop. d500ea0 completes 30b9bc2: a stopped or replaced watcher drops whatever still reaches it, including a folder read already under way. Approved by Adib before the tag; nothing is tagged yet.

30b9bc2 cleared the debounce on stop, and main's CI for the 2.89.0 release commit still failed on the Ubuntu arm64 runner: its new test saw a report 450 ms after the stop (`expected [ 450 ] to deeply equal []`), while the same commit's PR run and every local run passed. Clearing the timer covers only an edit that had not fired yet. Two paths stayed open: a debounce that had already fired was still reading the themes folder when the stop came, and its list resolved after it; and chokidar can report an edit while it closes, which armed a fresh timer.

Each watcher now reports only while it is still the current one. The stop marks it gone before closing it, and the timer, the read it starts and the edit handler all check that before acting, so nothing a stopped or replaced watcher saw reaches the listener, however late it resolves. A failed read is logged instead of left as an unhandled rejection. The test is unchanged: it steps the stop across the whole window, and the slow runner that caught this is where it shows.
@adibhanna
adibhanna merged commit d500ea0 into main Nov 20, 2026
23 of 26 checks passed
@adibhanna
adibhanna deleted the v2.89.0 branch November 20, 2026 15:44
@adibhanna
adibhanna deployed to boundary-artifacts November 20, 2026 16:14 — with GitHub Actions Active
MichaelC001 pushed a commit to MichaelC001/zennotes that referenced this pull request Nov 21, 2026
The renumber tests failed now and then on slow runners, last on Windows
x64 in PR ZenNotes#1098: "pads every marker once the list outgrows the column
(99 to 100)" kept the old padding. makeState forced a full parse with
ensureSyntaxTree, but that finishes the parse inside the language
state's context and leaves the tree syntaxTree(state) returns at the
one the state was created with. lang-markdown's
insertNewlineContinueMarkup reads syntaxTree(state), so when the
creation parse ran out of time partway down a long list, Enter did not
see the list at all. On a 200,000-line document the creation tree
covered 3,002 characters and still did after ensureSyntaxTree; an empty
transaction made it cover all 3,777,784.

makeState now returns state.update({}).state after the forced parse.
The app is not affected: a view keeps applying the parse worker's tree.
MichaelC001 pushed a commit to MichaelC001/zennotes that referenced this pull request Nov 21, 2026
Windows x64 failed main at abf115d and three runs of PR ZenNotes#1098 on
desktop tests that hit vitest's 5 s limit: the MCP "update_task on a
recurring task" cases, the vault demo tour, asset deletes. They are not
slow tests. "counts from the due date the same call sets" takes 26 ms
on a Mac, 2.5 s on a passing Windows run and over 8 s on the failing
one. One update_task call makes four fsyncs, across the note, its
agent-edit record and its creation record, and every test vault comes from os.tmpdir(), which on the runner is
C:\Users\runneradmin\AppData\Local\Temp, on the OS disk. The checkout
and RUNNER_TEMP are on D:.

A Windows job now sets TEMP and TMP to RUNNER_TEMP before anything
runs. Raising the timeout would have hidden the cost rather than
removed it. This is the likely cause, not yet a measured one: the first
Windows run on this commit is the comparison (the desktop suite took
140 s to 174 s on C:).

This branch was successfully deployed

1 active deployment
boundary-artifacts — d500ea01 Deployed Nov 20, 2026 by adibhanna via draft #140
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