fix(tasks): a tick asks again when the server answers not_saved_yet or the room still holds the save (#1179) #1181

Open
kayg wants to merge 6 commits from fix/flake-1179 into dev
Owner

Fixes #1179. tasks.set-status answered 503 not_saved_yet (retryable: "Not saved yet. Trying again.") or 409 block_changed (the room still holds the save of the write that made the task) was shown as "Couldn't change that task" / "changed somewhere else" and the box un-ticked. send() in tasks/status.ts now asks again (a fresh version each time):

  • 503 not_saved_yet: every 200 ms for up to 10 s;
  • 409 block_changed: besides the old window after this device's own write, in the first 6 refusals of a change (inside 10 s). Counted in asks, not seconds: a busy server answered "changed" after 2.9 s, which used up a 3 s window before the first retry.
    Everything else, and a conflict that lasts longer, still stands (the board's "three refusals" spec and the refusal spec are unchanged).

Commits alternate spec (red) and fix. Two new specs in tasks-tick.spec.ts: a mocked 503 twice and a mocked 409 twice, the tick must still end done with no failure toast.

Perf statement: error path only (a refusal); no change on typing, list scroll or note open.

Overlap: #1167 (same spec file, different hunks: the forced-click helper). Either order merges; the new specs here use the plain forced click, which #1167's helper can replace afterwards.

🤖 Generated with Claude Code

Fixes #1179. `tasks.set-status` answered 503 `not_saved_yet` (retryable: "Not saved yet. Trying again.") or 409 `block_changed` (the room still holds the save of the write that made the task) was shown as "Couldn't change that task" / "changed somewhere else" and the box un-ticked. `send()` in `tasks/status.ts` now asks again (a fresh version each time): - 503 `not_saved_yet`: every 200 ms for up to 10 s; - 409 `block_changed`: besides the old window after this device's own write, in the first 6 refusals of a change (inside 10 s). Counted in asks, not seconds: a busy server answered "changed" after 2.9 s, which used up a 3 s window before the first retry. Everything else, and a conflict that lasts longer, still stands (the board's "three refusals" spec and the refusal spec are unchanged). Commits alternate spec (red) and fix. Two new specs in `tasks-tick.spec.ts`: a mocked 503 twice and a mocked 409 twice, the tick must still end `done` with no failure toast. **Perf statement:** error path only (a refusal); no change on typing, list scroll or note open. Overlap: #1167 (same spec file, different hunks: the forced-click helper). Either order merges; the new specs here use the plain forced click, which #1167's helper can replace afterwards. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The server says 'Not saved yet. Trying again.' (retryable) while it publishes.
send() only retried block_changed, so a tick right after the task was made
un-ticked the box and showed 'Couldn't change that task'. It now asks again
every 200 ms for up to 10 s; every other refusal still stands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The server answers block_changed while the task note's room still holds a
save of its own (the write that made the task, from this or another client,
or a job). send() asked again only within 3 s of a set-status of this
device's, so a tick shortly after the task was made showed 'That task changed
somewhere else' and un-ticked. The first 3 s of any change now ask again
(a fresh version each time); a conflict that lasts longer still stands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A busy server took 3 s to answer 'changed', which used up the 3 s window before
the first retry; traced in a failing --workers=2 repeat.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fix(tasks): the early retries of 'changed' are counted in asks, not seconds (#1179)
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
766fb9d408
A busy server answered 'changed' after 2.9 s; the 3 s window was gone before the
retry. Six asks, inside 10 s, whatever each takes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Orchestrator: holding this one for a closer look. It retries a block_changed refusal even when this device did not write the task, which works around the server answering 503/409 while its room is still saving. The root cause looks server-side (#1182: set-status sent but never answered after ~22 repeats). Next step: find the server cause first, then decide whether the client retry is still needed.

Orchestrator: holding this one for a closer look. It retries a `block_changed` refusal even when this device did not write the task, which works around the server answering 503/409 while its room is still saving. The root cause looks server-side (#1182: set-status sent but never answered after ~22 repeats). Next step: find the server cause first, then decide whether the client retry is still needed.
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'fix/flake-1179:fix/flake-1179'
git switch 'fix/flake-1179'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'dev'
git merge --no-ff 'fix/flake-1179'
git switch 'fix/flake-1179'
git rebase 'dev'
git switch 'dev'
git merge --ff-only 'fix/flake-1179'
git switch 'fix/flake-1179'
git rebase 'dev'
git switch 'dev'
git merge --no-ff 'fix/flake-1179'
git switch 'dev'
git merge --squash 'fix/flake-1179'
git switch 'dev'
git merge --ff-only 'fix/flake-1179'
git switch 'dev'
git merge 'fix/flake-1179'
git push origin 'dev'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!1181
No description provided.