Preserve note state when rename destinations collide #629

Closed
kayg wants to merge 0 commits from issue/587-event-after-write-6 into dev
Owner

A rename whose planned destination becomes occupied now leaves the original path, file bytes and H1 unchanged and returns IdempotencyConflict. Rename jobs claim the destination with the existing exclusive move before applying the title or backlink edits. Stored jobs replay the move before those edits after a crash, and undo keeps the same destination-first ordering.

The public Notes::rename regression was ported from the review and failed on 5b4e4ea before the fix. It now checks both file images, the unchanged live title, zero committed steps, the conflict code and restart recovery. Two subprocess SIGKILL regressions cover the gap after the move and the gap after the title edit before progress is saved; both verify complete recovery and undo. The undo collision regression also checks the title remains unchanged.

Validation: cargo fmt --all -- --check; cargo clippy --workspace --all-targets -j4 -- -D warnings; cargo test --workspace -j4 -- --test-threads=4. All heavy local commands ran through the required build slot. Gate result lines and the failure reproduction are recorded on issue #587; artifacts remain outside the repository.

Refs: #587

A rename whose planned destination becomes occupied now leaves the original path, file bytes and H1 unchanged and returns IdempotencyConflict. Rename jobs claim the destination with the existing exclusive move before applying the title or backlink edits. Stored jobs replay the move before those edits after a crash, and undo keeps the same destination-first ordering. The public Notes::rename regression was ported from the review and failed on 5b4e4ea before the fix. It now checks both file images, the unchanged live title, zero committed steps, the conflict code and restart recovery. Two subprocess SIGKILL regressions cover the gap after the move and the gap after the title edit before progress is saved; both verify complete recovery and undo. The undo collision regression also checks the title remains unchanged. Validation: cargo fmt --all -- --check; cargo clippy --workspace --all-targets -j4 -- -D warnings; cargo test --workspace -j4 -- --test-threads=4. All heavy local commands ran through the required build slot. Gate result lines and the failure reproduction are recorded on issue #587; artifacts remain outside the repository. Refs: #587
kayg added 15 commits 2026-10-19 15:37:42 +00:00
Reconcile note lists from durable writes before publishing hints
Some checks failed
CI / server (pull_request) Successful in 23s
CI / web (pull_request) Failing after 32s
CI / rust (pull_request) Successful in 4m22s
e174661153
Place absent files exclusively so an outside create survives the placement
window and is returned as a conflict. Propagate deletion-history failures
through discovery so startup remains incomplete until its retry succeeds.
Key lifecycle diagnostics by note identity so independent sibling futures
can wait safely in one Tokio task.

Skip backlink parsing without an opening bracket and stop tag scanning
after the last hash's line. This removes unnecessary full-text parsing
from synchronous list publication. Add permanent regression tests for the
three review findings and both scan failure stages.

Refs: #587
Preserve note placements and bound failed discovery
Some checks failed
CI / server (pull_request) Successful in 32s
CI / web (pull_request) Failing after 48s
CI / rust (pull_request) Failing after 1m56s
5b4e4ea47b
Use exclusive note moves and guarded writes through create, bulk jobs,
Trash, restore and migration. Keep stored destinations fixed until their
dependent edits can run, and preserve the original create version on replay.

Bound startup retries and retain an actionable failed-scan health state
while known notes remain usable. Serialize independent same-id create
futures without mistaking their shared Tokio task for recursive entry.

Refs: #587
Base-commit: 80e94699a6
Claim rename destinations before editing note titles
Some checks failed
CI / server (pull_request) Successful in 27s
CI / web (pull_request) Failing after 38s
CI / rust (pull_request) Successful in 5m20s
0104c0fe1d
Keep the original title and path unchanged when a planned destination becomes occupied. Preserve the placement conflict code through bulk jobs. Replay exclusive moves before title edits and retain destination-first undo ordering.

Port the public API collision regression and cover restart after conflict, real process death at both move/title boundaries, and undo title preservation.

Refs: #587
Base-commit: 5b4e4ea47b
Author
Owner

Landed in train AJ, #633.

Landed in train AJ, #633.
kayg closed this pull request 2026-10-19 17:59:58 +00:00
Some checks failed
CI / server (pull_request) Successful in 27s
CI / web (pull_request) Failing after 38s
CI / rust (pull_request) Successful in 5m20s

Pull request closed

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!629
No description provided.