fix: four review issues (search cap, tagging pause, stale tag, walkdir)

- commands: semantic search doubling loop now returns when batch reaches
  the 8192 cap rather than re-fetching the same IDs forever when filters
  yield fewer than limit matches (P1 infinite loop)

- db/indexer: tagging worker checks is_tagging_job_processing instead
  of is_tagging_job_cancelled so paused jobs reset to 'pending' are also
  discarded; cancelled rows are deleted, paused rows kept for retry

- Lightbox: capture image id at form-submit time and compare against
  currentImageIdRef in the addUserTag callback, matching the guard
  already applied to the getImageTags effect

- indexer: WalkDir errors are no longer silently swallowed; paths under
  unreadable subtrees are excluded from the missing-file deletion pass
  using Path::starts_with (component-aware) so a transient permission
  error cannot cascade into data loss or affect sibling directories
This commit is contained in:
2026-06-07 23:25:25 +01:00
parent 7ead26d7fb
commit ba989b37b9
4 changed files with 66 additions and 8 deletions
+12
View File
@@ -2024,6 +2024,18 @@ pub fn is_tagging_job_cancelled(conn: &Connection, image_id: i64) -> Result<bool
Ok(count > 0)
}
/// Returns `true` when the job row for `image_id` is still `processing`.
/// A `false` result means the row was reset to `pending` (pause) or `cancelled`
/// while inference was running — either way the result must be discarded.
pub fn is_tagging_job_processing(conn: &Connection, image_id: i64) -> Result<bool> {
let count: i64 = conn.query_row(
"SELECT COUNT(*) FROM tagging_jobs WHERE image_id = ?1 AND status = 'processing'",
[image_id],
|row| row.get(0),
)?;
Ok(count > 0)
}
pub fn requeue_tagging_jobs(conn: &Connection, image_ids: &[i64]) -> Result<()> {
for image_id in image_ids {
conn.execute(