Skip to content

Refactor: one endMoving() for the move and the delete from the Device (#890) - #948

Merged
Skeyelab merged 1 commit into
mainfrom
refactor/890-end-moving
Oct 23, 2026
Merged

Skeyelab merged 1 commit into
mainfrom
refactor/890-end-moving

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

refactor: merge after the v1.1.16 tag. It touches the move and delete code, so Eric approves it after the tag.

One item of #890. moveDriveOnlyTakes and releaseFromDevice each carried the same block that clears isMoving and resumes the edits waiting on a move. It is now endMoving(). releaseFromDevice also lets the Drive go with a defer, so it is let go once on every way out and none of its early returns needs its own access.end().

No red test is possible: it changes no behavior that a test can see. One small difference, found by the Code Reviewer: releaseFromDevice now holds the Drive until it returns, through the few lines that update the moves list, regenerate the report and read the Drive's Take.json (Self.readTake), where before it was let go right after the delete ran. That is safer (the read is on the Drive), and the access still ends before endMoving lets waiting edits go (the order is commented). The state changes in the move path keep their order apart from foundTakesToMove and isMoving swapping places inside one synchronous defer.

Added driveLetGoOnce in RecorderReleaseTests: a counting stop: closure shows the Drive is let go exactly once for a kept and a released delete, and isMoving is false afterward. It passes before and after the refactor (a guard, not a red test). The existing MoveTriggerTests, MoveStandInTests and RecorderReleaseTests cover both functions and the waiters. VERIFY_QUICK=1 ./scripts/verify.sh passes.

…#890)

moveDriveOnlyTakes and releaseFromDevice each had the same block that clears isMoving and resumes
the edits that waited for a move. It is now endMoving(), and releaseFromDevice lets the Drive go
with a defer (once, on every way out). One difference: the Drive stays held through the few
lines that update the moves list and read the Drive's Take.json, where it was let go before them.

Assisted-by: Claude Code:claude-sonnet-5-5
@Skeyelab
Skeyelab enabled auto-merge (squash) October 23, 2026 03:51
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Skeyelab
Skeyelab merged commit 7af8807 into main Oct 23, 2026
11 checks passed
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