Repository navigation
fix: review sweep of the analysis path (runs, model memory, vision, Whisper, watcher, dates) - #109
Merged
Merged
Conversation
…hisper, watcher, dates)
Discover runs
- A run with audio or video always goes through the batch; the batch keeps
reporting during one long file and is bounded by its own checks instead of
a fixed 30-minute request timeout and a 5-minute "stuck" check.
- A cancelled batch reports nothing more; a cancelled file is neither failed
nor recorded. A progress update held by the renderer's throttle is dropped
when its analysis ends ("Analysis paused" after Stop).
- Only a Discover analysis writes analysis progress, and only the running
batch's own events are accepted.
- A run that waited for an earlier batch shows the counts of the whole run.
- A run that holds the lock and was not aborted counts as active from the
moment it took the lock: a second call during its start-up is queued
instead of resetting it as stale.
- A run replaced during its start-up pause stops there, and a heartbeat
clears only its own interval (StrictMode resume lost its heartbeat).
- setFileStates(prev => next) reads prev from the store, not from the last
render, in Discover and Organize.
- The Dashboard waits for a running analysis.
Models
- Memory counts from the start of a load; a second caller shares the load;
external consumers reserve before they start.
- The vision runtime is not shut down under a running image, a failed start
is reported, a timed-out request releases its pin, and a connection closed
mid-answer settles the request.
- Cancelling one analysis does not cancel another that shares its
transcription. A recording past the transcription limit is recorded once.
Watcher
- Checks the history again before analyzing, records the file as it was when
the analysis started, pauses an image batch for a Discover run, and keeps
a reanalysis request across a change to the same file.
Dates
- Suggested names, the file date given to the model, dates read from content
and the settings export name use the local calendar day. The history
date-range walk steps through UTC months, as the index is keyed.
Tests
- New suites for pending loads, per-zone dates (child process per zone),
the live-store updater, image cancellation and the progress middleware.
- useAnalysis tests clear the module-level resume flag after each test; a
test that unmounted mid-run started a resume in the next one.
The probe runs in a plain Node child process, without the module mapping of jest.config.js. One of the modules it loads requires 'electron', and the entry point of that package downloads the Electron binary when it is not on disk yet and prints "Downloading Electron binary..." to stdout. On a fresh CI runner the first zone's output was that line followed by the JSON, and JSON.parse failed (ci, ubuntu-latest). The later zones found the binary on disk and passed. The probe now puts an empty module in place of 'electron' before it loads anything, as the mapping does for the tests themselves. The output is still parsed as a whole, so anything else written to stdout fails the test.
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.
A review sweep over the analysis path after #107 and #108: the Discover run in the renderer, the batch handler, the model memory manager, the vision runtime, Whisper, the smart-folder watcher, and dates. Each fix has a regression test that was run against the code before the fix and failed there for the reason the fix addresses.
CHANGELOG.md([Unreleased]→ Fixed) has the user-facing wording for all of it.What changes for the user
Discover runs
setFileStates(prev => …)got the list the hook last rendered with, not the one in the store.Models and memory
Smart-folder watcher
Dates
Logs
Tests
New:
ModelMemoryManager.pendingLoads,calendarDayLocalTime(each zone in a child process, since CI runs in UTC and Jest copiesprocess.env),fileStatesUpdaterLiveStore,imageAnalysis.cancellation,ipcMiddleware.progressAfterStop,ipcMiddleware.runBase; additions to the existing suites of the files touched.The child process of
calendarDayLocalTimeis plain Node, so it does not have Jest's module mapping. One of the modules it loads requireselectron, whose entry point downloads the Electron binary when it is not on disk and prints "Downloading Electron binary..." to stdout. That failed the first zone on a fresh Ubuntu runner (first push of this PR). The probe now puts an empty module in place ofelectron, as the mapping does (second commit).test/useAnalysis.test.jsnow clears the module-level "resume after unmount" flag after each test. A test that unmounted in the middle of a run started a resume in the next test; the stale-lock takeover fixed here used to hide that.Local:
typecheck,typecheck:js,format:check,verify:checkjs-ratchet(493/493), eslint on the changed files, and the full Jest suite.Looked at and left
finallyhandles it and it sends nothing (fix(discover): an aborted run sends no batch; the watcher yields to Discover runs #108).MAX_ANALYSIS_RETRIES.sendOperationProgressthrottles through one pending slot shared by all senders, so one sender's held update can replace another's. Two senders at once would take an Organize batch during a Discover batch, which navigation blocks.ModelMemoryManager.pendingLoads.test.jsuses real timers with 20–70 ms waits inside a 500 ms window.NavigationBaronly.Not verified here: behaviour on real hardware beyond the dev build on one 6 GB laptop GPU, and the open CodeQL alerts.