BLOCKER: tasks.create fails ("Couldn't add it") after Undo trashed the day note (since #981) #990

Closed
opened 2026-11-06 20:44:35 +00:00 by kayg · 1 comment
Owner

Found by the daily train 2026-11-06 (#989) on D 935fdcacd.

Symptom: add a task on a day with no note (the task makes the day note), press Undo (the day note goes to Trash), add another task: the Composer toast says "Couldn't add it. Try again." and nothing is written.
Spec: apps/web/e2e/composer-tasks.spec.ts :51 and :82 (all four browser/width projects). --repeat-each=10 on D: chromium-1440 10/20 fail, chromium-390 10/50, webkit-1440 19/30, webkit-390 fails. On prod 71827028: 0 failures (webkit-1440 120 pass, chromium-1440 120 pass bar the shortcuts spec, chromium-390 30 pass).
Bisect (webkit-1440, spec alone, x10): 7b1f90b2f (just before) 30/30 pass; db15794ac (merge of #981) 19/30 fail.
Owning PR: #981 ("today's note in Trash makes a fresh note"): daily.open no longer restores a trashed day note and derives a successor id instead.
Hypothesis (not proven): crates/notes/src/capture.rs capture_task and bulk/steps.rs create still assume the stable day-YYYY-MM-DD id (reusable_daily, empty_daily are keyed on the day- prefix). When the day note was re-made by daily.open under a successor id (unwritten placeholder), the capture's Step::Create for it is rejected. It touches bulk jobs and undo history, so no quick patch was made in the train.
Same root, second spec: shortcuts.spec.ts:151 expects T to open #/note/day-…; after any earlier test trashed the day, it gets a uuid. D fails it 20/20 (chromium-1440 and webkit-1440). Prod also fails it 10/20 in both, so it is also flaky on prod (needs its own fix, not only this one).
Expected fix: capture must resolve the day through the same identity as daily.open (Notes::daily_id), and the specs must not assume a day- id. Also repeated_create_undo_recreates_daily_with_retained_history in crates/tasks/src/create_tests.rs asserts the same id twice: check it still means what it says.
Gate for the fix: composer-tasks.spec.ts --repeat-each=10 in chromium-1440/390 and webkit-1440/390, shortcuts.spec.ts, cargo test -p calternal-tasks -p calternal-notes -p calternal-daily.

Found by the daily train 2026-11-06 (#989) on D `935fdcacd`. **Symptom:** add a task on a day with no note (the task makes the day note), press Undo (the day note goes to Trash), add another task: the Composer toast says "Couldn't add it. Try again." and nothing is written. **Spec:** `apps/web/e2e/composer-tasks.spec.ts` :51 and :82 (all four browser/width projects). `--repeat-each=10` on D: chromium-1440 10/20 fail, chromium-390 10/50, webkit-1440 19/30, webkit-390 fails. On prod `71827028`: 0 failures (webkit-1440 120 pass, chromium-1440 120 pass bar the shortcuts spec, chromium-390 30 pass). **Bisect** (webkit-1440, spec alone, x10): `7b1f90b2f` (just before) 30/30 pass; `db15794ac` (merge of **#981**) 19/30 fail. **Owning PR: #981** ("today's note in Trash makes a fresh note"): `daily.open` no longer restores a trashed day note and derives a successor id instead. **Hypothesis (not proven):** `crates/notes/src/capture.rs` `capture_task` and `bulk/steps.rs` `create` still assume the stable `day-YYYY-MM-DD` id (`reusable_daily`, `empty_daily` are keyed on the `day-` prefix). When the day note was re-made by `daily.open` under a successor id (unwritten placeholder), the capture's `Step::Create` for it is rejected. It touches bulk jobs and undo history, so no quick patch was made in the train. **Same root, second spec:** `shortcuts.spec.ts:151` expects `T` to open `#/note/day-…`; after any earlier test trashed the day, it gets a uuid. D fails it 20/20 (chromium-1440 and webkit-1440). Prod also fails it 10/20 in both, so it is also flaky on prod (needs its own fix, not only this one). **Expected fix:** capture must resolve the day through the same identity as `daily.open` (`Notes::daily_id`), and the specs must not assume a `day-` id. Also `repeated_create_undo_recreates_daily_with_retained_history` in `crates/tasks/src/create_tests.rs` asserts the same id twice: check it still means what it says. Gate for the fix: `composer-tasks.spec.ts` `--repeat-each=10` in chromium-1440/390 and webkit-1440/390, `shortcuts.spec.ts`, `cargo test -p calternal-tasks -p calternal-notes -p calternal-daily`.
Author
Owner

Fixed by #993, merged into dev as 1e903a13a.

Fixed by #993, merged into dev as `1e903a13a`.
kayg closed this issue 2026-11-07 02:54:45 +00:00
Sign in to join this conversation.
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#990
No description provided.