Repair scan integrity, access controls, and audit findings - #85
Merged
Merged
Conversation
…v2.8.9) Audio validation ran three full-file passes on fixed deadlines (120s, 120s, 60s) while the video path scaled its deadline with size and duration, so a two-hour episode timed out and was recorded as a warning without ever being validated: 159 files on one library. Video and audio now compute the deadline through one helper, and the audio passes share a single per-file budget. Orphan cleanup judged a whole run by the share of it that read as missing, which aborted a cleanup of records for files the operator had deleted and missed a mount dropping under a scan path holding several. Each file is now confirmed by reading its own directory: other files in it prove the storage is present. An empty or missing directory is kept and counted instead, since an unmounted mountpoint reads the same, and the operator can confirm those. An aborted run also reported itself as a success, with the orphan count rendered as a deletion count and the reason unread in the status payload.
The v2.8.9 migration altered 'cleanup_states'; the table is 'cleanup_state'. Migrations here log and swallow their failures, so the column never arrived while the model kept selecting it, and /api/cleanup-status returned 500 on every poll of a deployed 2.8.9. A test now rejects any migration naming a table the models do not define.
A library with one file per folder could not clean up anything: deleting a film empties or removes its folder, leaving nothing in it to read, so every record was kept for confirmation. On a real library that was 44 of 46 flagged files in one run. When a folder has nothing to say, the question moves up a level. The parent has to list folders and one of those has to hold a file this scanner recorded, which is the library answering rather than leftovers on an unmounted mountpoint. A tree that has gone entirely still has nothing above it to answer. Also corrects the completion message, which called kept records ones whose folder could not be read; a folder emptied by a deletion reads perfectly well.
Three issues found in production logs. The cross-worker start lock read db.session.bind, which is None unless a session was bound explicitly, so every call raised and the handler's log-and-proceed fallback waved through every caller it ever saw. A schedule skipped by a running scan spent its retry budget while waiting: 144 retries ten minutes apart is one day, and a large scan runs longer. Live, a 27-hour scan had one schedule at retry 106 of 144. Waiting on a scan that is reporting progress no longer counts; a scan quiet for half an hour still does. Two INFO lines on /api/scan-status were 42% of all output, on an endpoint each open tab polls every few seconds, against a log table already at a million rows. Both are DEBUG now.
ttlequals0
marked this pull request as ready for review
September 12, 2026 22:02
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.
Why
PixelProbe 2.9.3 restores selected-scan progress and saved settings. This PR also contains the audit repairs.
Added
Fixed
Changed
Verification
003bf56aaa75895254585952f571fa0c01f609f2.latestimage tag remains unchanged.Related PR
PR #84 is closed and already included. No separate merge is required.