Under --skip-errors, an error recording a directory or symlink in the local index was skipped as if the entry could not be read. The snapshot then completed without the entry, so a restore did not recreate the directory with its stored owner, mode and times, or did not recreate the symlink.
processFileWithErrorHandling now records a directory or symlink itself, before any of the skip handling, and returns any error, so the backup stops as it already did without the flag. processFileStreaming now handles only regular files: the skip sees only their errors, and of those a packer error still stops the run, as before. countFailedFile loses its directory check, since no directory reaches it any more.
The new test in internal/vaultik/snapshot_skip_errors_test.go adds a SQLite trigger that makes the local index refuse the directory's files row, runs CreateSnapshot with SkipErrors, and checks that the run fails and the snapshot has no CompletedAt.
Judgement call: the README and the --skip-errors help are unchanged. Both already limit the flag to files that cannot be read, and the change makes neither false.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/vaultik/issues/284.
Under `--skip-errors`, an error recording a directory or symlink in the local index was skipped as if the entry could not be read. The snapshot then completed without the entry, so a restore did not recreate the directory with its stored owner, mode and times, or did not recreate the symlink.
`processFileWithErrorHandling` now records a directory or symlink itself, before any of the skip handling, and returns any error, so the backup stops as it already did without the flag. `processFileStreaming` now handles only regular files: the skip sees only their errors, and of those a packer error still stops the run, as before. `countFailedFile` loses its directory check, since no directory reaches it any more.
The new test in `internal/vaultik/snapshot_skip_errors_test.go` adds a SQLite trigger that makes the local index refuse the directory's `files` row, runs `CreateSnapshot` with `SkipErrors`, and checks that the run fails and the snapshot has no `CompletedAt`.
Judgement call: the README and the `--skip-errors` help are unchanged. Both already limit the flag to files that cannot be read, and the change makes neither false.
Model: opus-5-5
internal/snapshot/scanner.go:1409-1413: countFailedFile still returns early for a directory, and its comment still says a directory is not counted there. After this change no directory reaches countFailedFile, because processFileWithErrorHandling records directories and symlinks before any of the skip handling and returns their errors. The branch can no longer run, and it tells a reader that a directory can fail in phase 2 and be skipped, which the new comment in processFileWithErrorHandling says cannot happen. Acceptable: remove the IsDir early return and the sentence about directories from countFailedFile's comment.
Model: opus-5-5
1. `internal/snapshot/scanner.go:1409-1413`: `countFailedFile` still returns early for a directory, and its comment still says a directory is not counted there. After this change no directory reaches `countFailedFile`, because `processFileWithErrorHandling` records directories and symlinks before any of the skip handling and returns their errors. The branch can no longer run, and it tells a reader that a directory can fail in phase 2 and be skipped, which the new comment in `processFileWithErrorHandling` says cannot happen. Acceptable: remove the `IsDir` early return and the sentence about directories from `countFailedFile`'s comment.
Model: opus-5-5
Under --skip-errors, an error recording a directory or symlink in the
local index was skipped like an unreadable file. The snapshot completed
without the entry, and a restore did not recreate it.
processFileWithErrorHandling now records a directory or symlink itself
and returns any error, which stops the backup with or without the flag.
The skip sees only a regular file's errors, so countFailedFile no longer
checks for a directory.
The test injects the error with a SQLite trigger that refuses the
directory's files row.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #284.
Under
--skip-errors, an error recording a directory or symlink in the local index was skipped as if the entry could not be read. The snapshot then completed without the entry, so a restore did not recreate the directory with its stored owner, mode and times, or did not recreate the symlink.processFileWithErrorHandlingnow records a directory or symlink itself, before any of the skip handling, and returns any error, so the backup stops as it already did without the flag.processFileStreamingnow handles only regular files: the skip sees only their errors, and of those a packer error still stops the run, as before.countFailedFileloses its directory check, since no directory reaches it any more.The new test in
internal/vaultik/snapshot_skip_errors_test.goadds a SQLite trigger that makes the local index refuse the directory'sfilesrow, runsCreateSnapshotwithSkipErrors, and checks that the run fails and the snapshot has noCompletedAt.Judgement call: the README and the
--skip-errorshelp are unchanged. Both already limit the flag to files that cannot be read, and the change makes neither false.Model: opus-5-5
internal/snapshot/scanner.go:1409-1413:countFailedFilestill returns early for a directory, and its comment still says a directory is not counted there. After this change no directory reachescountFailedFile, becauseprocessFileWithErrorHandlingrecords directories and symlinks before any of the skip handling and returns their errors. The branch can no longer run, and it tells a reader that a directory can fail in phase 2 and be skipped, which the new comment inprocessFileWithErrorHandlingsays cannot happen. Acceptable: remove theIsDirearly return and the sentence about directories fromcountFailedFile's comment.Model: opus-5-5
4c3ea7ae15to91e4bf92abRework:
IsDirearly return fromcountFailedFileand the sentence about directories from its comment.Model: opus-5-5
Review passed.
Model: opus-5-5