Repository navigation
Conversation
Three failures in a row of a kind that counts as systemic (or the first
failure in strict mode) stop a batch. When no move had been confirmed
there is nothing to roll back, so the result carried no rolledBack flag.
Files that were mid-move got an "interrupted" row, files that had not
started got no row, and the summary counted neither ("0 successful, 4
failed" for a run of 8). The Organize screen showed "No files were
organized" with the first failure only.
- The batch handler writes one row for every op. An op the run did not
reach is `notAttempted`, not `interrupted`: nothing resumes it. The
result has stoppedOnFailure, stopReason and notAttemptedCount, and the
summary ends with "N not attempted".
- A rolled-back result carries notAttemptedCount and the same rows.
- A file an earlier run already moved keeps its row when the resumed run
is stopped.
- The Organize screen says "Organization was stopped; no files were
moved", then the first failure, the number of failures and the number
of files not attempted. Untried files are not counted as failures. The
rolled-back message also says how many files were not attempted.
- The undo provider adds no history entry and shows no "completed" toast
for a stopped batch. Main records no undo for it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #126, which listed this under "Not in this PR": a run stopped by failures before any move was confirmed has nothing to roll back, and its result left out the files it never tried.
What changes
The batch handler (
batchOrganizeHandler.js)interruptedrow, files that had not started got no row, and the summary counted neither ("0 successful, 4 failed" for a run of 8).notAttempted: true. It is notinterrupted, because the journal batch is closed and nothing resumes it.stoppedOnFailure: true,stopReasonandnotAttemptedCount, and its summary ends with the count:Processed 8 files: 0 successful, 3 failed, 5 not attempted.successstaysfalse.notAttemptedCountand the same rows.resumedrow when the resumed run is stopped. It had no row before.The Organize screen (
useOrganization.js)Undo history (
UndoRedoSystem.jsx)Not in this PR
maintoday (observed with a throwaway test, not committed) and needs its own change, because the same toast also appears beside the warning for a partly failed run.Checks
Windows 11 x64, on this branch's tree:
npm run local:gate, every step: 957 test suites, 14169 tests passed, 11 skipped, coverage thresholds met, production build, native modules.test/batchOrganizeHandler.failureHandling.test.js(6, mocked filesystem): a stopped run with nothing moved, the same with several files at a time, strict mode, a run that was not stopped, a stopped run with a move to undo, and a resumed run.test/batchOrganize.moveCheckFailsAlone.realfs.test.js(1, real filesystem in a temp folder): a destination that takes every temporary copy stops the run, every one of the 8 files has a row and all 8 are still in the input folder.test/useOrganization.runOutcome.test.js(2),test/useOrganization.rolledBackBatch.test.js(1) andtest/components/UndoRedoSystem.rolledBackBatch.test.js(1) cover the messages and the undo history.interruptedagain, the stop fields dropped, the count left out of the rollback result and of the summary, untried rows counted as failures, the stop sentence and the headline dropped, the count left out of the rolled-back message, the undo guard removed) each fail at least one of the new tests. The files were restored after each.Not checked: macOS and Ubuntu (this PR's CI runs Ubuntu; macOS runs when
mainnext builds), a packaged build, and the Organize screen in the running app. The messages are checked through the hook's tests, not by eye.