Provide explicit cancellation for analysis and consistent Stop behavior across server tasks #8

Closed
opened 2026-10-24 13:26:52 +00:00 by jchapman · 5 comments
Owner

Closing a browser is navigation, not cancellation. Preview/import already have a stop request, but analysis lacks an equivalent user control. All server tasks need a clear cancellation lifecycle.

Acceptance criteria:

  • Allow the owner to cancel queued or running analysis, preview and import.
  • Confirm stage-specific consequences, show “Stopping…” after a request, and show “Stopped” only after worker confirmation and cleanup.
  • Preserve accepted ZIPs and any state that is safe to reuse. Do not promise unsupported mid-import resumption.
  • Explain that assets already committed to Immich remain. Never roll them back or automatically restart an interrupted import.
  • Keep closing/reopening a tab independent of cancellation.
  • Handle completion racing with cancellation truthfully and make repeated stop requests safe.
  • Test owner authorization, queued/running cancellation, process cleanup, preserved inputs and completion races.
Closing a browser is navigation, not cancellation. Preview/import already have a stop request, but analysis lacks an equivalent user control. All server tasks need a clear cancellation lifecycle. Acceptance criteria: - Allow the owner to cancel queued or running analysis, preview and import. - Confirm stage-specific consequences, show “Stopping…” after a request, and show “Stopped” only after worker confirmation and cleanup. - Preserve accepted ZIPs and any state that is safe to reuse. Do not promise unsupported mid-import resumption. - Explain that assets already committed to Immich remain. Never roll them back or automatically restart an interrupted import. - Keep closing/reopening a tab independent of cancellation. - Handle completion racing with cancellation truthfully and make repeated stop requests safe. - Test owner authorization, queued/running cancellation, process cleanup, preserved inputs and completion races.
Author
Owner

Starting implementation together with #4 and #7 after reading #14 and all current comments. Scope: owner-authorized, idempotent stop requests for queued/running analysis, preview and import; stage-specific confirmation; Stopping until worker/process cleanup is confirmed; preserve accepted ZIPs; keep already imported assets and never automatically replay interrupted imports. Validation will cover cancellation, authorization and completion races. No active server task will be interrupted for deployment.

Starting implementation together with #4 and #7 after reading #14 and all current comments. Scope: owner-authorized, idempotent stop requests for queued/running analysis, preview and import; stage-specific confirmation; Stopping until worker/process cleanup is confirmed; preserve accepted ZIPs; keep already imported assets and never automatically replay interrupted imports. Validation will cover cancellation, authorization and completion races. No active server task will be interrupted for deployment.
Author
Owner

Finding: analysis cancellation previously lacked a control and the runner client waited for cleanup only on cancelled imports. Implementation adds an owner-scoped, durable analysis stop flag and atomic queued-work fencing; runner termination now requires container-removal confirmation for all task kinds. Import terminal state is deferred until proxy/log/staging cleanup. Cleanup uncertainty reports Interrupted rather than Stopped. Docker socket access is denied in this session, and native SQLite tests currently lack a C compiler; these are validation limitations, not deployment authorization.

Finding: analysis cancellation previously lacked a control and the runner client waited for cleanup only on cancelled imports. Implementation adds an owner-scoped, durable analysis stop flag and atomic queued-work fencing; runner termination now requires container-removal confirmation for all task kinds. Import terminal state is deferred until proxy/log/staging cleanup. Cleanup uncertainty reports Interrupted rather than Stopped. Docker socket access is denied in this session, and native SQLite tests currently lack a C compiler; these are validation limitations, not deployment authorization.
Author
Owner

Implemented and published for review in commit e980c3778a76c66c280234e29a3c324f5e7ae56c, branch codex/issues-4-7-8-activity, PR #17: #17 . The working tree is clean. This supersedes the earlier tooling/validation limitations.

VALIDATION

  • Local Linux AMD64 Docker backend tests and vet, including the pinned real importer fixtures; focused API cancellation/authorization/completion-race checks under the race detector and the complete runner race suite.
  • Real Docker isolation: fixed verification/analysis stage messages, persistent inputs, container removal, and actual importer cancellation/final private-log transfer.
  • UI lint/build; focused two-owner-browser synthetic activity tests for missing/stale status, stage transitions, offline/reconnect restoration, repeated navigation without cancellation, stage-specific Stop confirmation, Stopping/Stopped, explicit analysis retry and completion winning a late stop. Mobile screenshot inspected.
  • Disposable complete browser/queue/SQLite walkthrough, upload interruption/reselection/resume, history, protected diagnostics and administrator settings. App/runner/processor were rebuilt from the committed source and the final full smoke check passed. HTTPS proxy/upload-resume/readiness smoke also passed during implementation. Only disposable test containers were restarted; no real Immich/media/email was used.
  • Nine CI contract/policy tests, source-tree/document checks, staged diff checks, tracked-source and full-history secret scans (no leaks). Source gosec: 35 production files, 29 previously reviewed findings, no loading errors or suppressions; source govulncheck passed the existing policy. No baseline exceptions or dependency changes were added. The existing UI large-bundle advisory remains.

STATE / LIMITS / HANDOFF
Source is committed and pushed for review; not merged, release-image-published or deployed. Forgejo run https://git.sharedroot.net/jchapman/Immich-Bridge/actions/runs/5 is waiting for the AMD64/ARM64 source jobs, with dependent gates blocked. No native release CI pass or native ARM64 execution is claimed. Real large-library performance and deployed pilot behavior remain unverified.

Review #17. It is stacked on #16, which itself follows #15; after those merge, retarget #17 to main and verify the diff and required gates. Coordinate an idle installation of app, runner and processor together, then run an owner pilot preview and check the task lifecycle before closing this issue. Do not interrupt active uploads/tasks for deployment. No automatic import replay, rollback or unsupported mid-import resume is promised.

ISSUE #8 CHANGES
New owner-scoped analysis status/Stop endpoints persist cancellation and atomically fence queued worker claims. Running analysis checks the saved stop flag and cancels its processor. Preview/import retain owner authorization and gain the same confirmation/panel lifecycle. Repeated and late requests are safe; successful completion can win a late Stop.

Stopping remains visible until worker exit, processor container removal, log/proxy handling and temporary staging cleanup are confirmed. Terminal runner events are sent only after container removal; unhealthy or unreachable cleanup is Interrupted with an administrator recovery action, never falsely Stopped. A cancellation before submission does not contact the runner or wait for unrelated work. Cleanup failures are checked rather than silently discarded.

Accepted ZIPs and safe completed analysis remain available. Analysis/preview can be explicitly restarted; assets already committed to Immich remain without rollback, and interrupted imports never replay automatically. Tests cover foreign-owner denial, queued/running Stop, preserved inputs, held-open cleanup, repeated/late requests, cleanup uncertainty and completion races for preview and write imports. See docs/results.md and docs/testing.md.

Implemented and published for review in commit `e980c3778a76c66c280234e29a3c324f5e7ae56c`, branch `codex/issues-4-7-8-activity`, PR #17: https://git.sharedroot.net/jchapman/Immich-Bridge/pulls/17 . The working tree is clean. This supersedes the earlier tooling/validation limitations. VALIDATION - Local Linux AMD64 Docker backend tests and vet, including the pinned real importer fixtures; focused API cancellation/authorization/completion-race checks under the race detector and the complete runner race suite. - Real Docker isolation: fixed verification/analysis stage messages, persistent inputs, container removal, and actual importer cancellation/final private-log transfer. - UI lint/build; focused two-owner-browser synthetic activity tests for missing/stale status, stage transitions, offline/reconnect restoration, repeated navigation without cancellation, stage-specific Stop confirmation, Stopping/Stopped, explicit analysis retry and completion winning a late stop. Mobile screenshot inspected. - Disposable complete browser/queue/SQLite walkthrough, upload interruption/reselection/resume, history, protected diagnostics and administrator settings. App/runner/processor were rebuilt from the committed source and the final full smoke check passed. HTTPS proxy/upload-resume/readiness smoke also passed during implementation. Only disposable test containers were restarted; no real Immich/media/email was used. - Nine CI contract/policy tests, source-tree/document checks, staged diff checks, tracked-source and full-history secret scans (no leaks). Source gosec: 35 production files, 29 previously reviewed findings, no loading errors or suppressions; source govulncheck passed the existing policy. No baseline exceptions or dependency changes were added. The existing UI large-bundle advisory remains. STATE / LIMITS / HANDOFF Source is committed and pushed for review; not merged, release-image-published or deployed. Forgejo run https://git.sharedroot.net/jchapman/Immich-Bridge/actions/runs/5 is waiting for the AMD64/ARM64 source jobs, with dependent gates blocked. No native release CI pass or native ARM64 execution is claimed. Real large-library performance and deployed pilot behavior remain unverified. Review #17. It is stacked on #16, which itself follows #15; after those merge, retarget #17 to main and verify the diff and required gates. Coordinate an idle installation of app, runner and processor together, then run an owner pilot preview and check the task lifecycle before closing this issue. Do not interrupt active uploads/tasks for deployment. No automatic import replay, rollback or unsupported mid-import resume is promised. ISSUE #8 CHANGES New owner-scoped analysis status/Stop endpoints persist cancellation and atomically fence queued worker claims. Running analysis checks the saved stop flag and cancels its processor. Preview/import retain owner authorization and gain the same confirmation/panel lifecycle. Repeated and late requests are safe; successful completion can win a late Stop. Stopping remains visible until worker exit, processor container removal, log/proxy handling and temporary staging cleanup are confirmed. Terminal runner events are sent only after container removal; unhealthy or unreachable cleanup is Interrupted with an administrator recovery action, never falsely Stopped. A cancellation before submission does not contact the runner or wait for unrelated work. Cleanup failures are checked rather than silently discarded. Accepted ZIPs and safe completed analysis remain available. Analysis/preview can be explicitly restarted; assets already committed to Immich remain without rollback, and interrupted imports never replay automatically. Tests cover foreign-owner denial, queued/running Stop, preserved inputs, held-open cleanup, repeated/late requests, cleanup uncertainty and completion races for preview and write imports. See docs/results.md and docs/testing.md.
Author
Owner

Integration handoff: PR #17 is merged into main in 8230741. The final combined source passed local backend/vet/race, UI/browser, container/isolation/HTTPS, source/image policy and secret checks. Detailed merge/conflict evidence and limitations: #14 (comment). Native Forgejo AMD64/ARM64 release validation remains queued; no release images or deployment are claimed. This issue remains open for its pilot checkpoint. Verify the deployed owner Stop lifecycle and cleanup confirmation while retaining accepted ZIPs and already imported assets. No active upload/task or pilot service was interrupted.

Integration handoff: PR #17 is merged into main in `8230741`. The final combined source passed local backend/vet/race, UI/browser, container/isolation/HTTPS, source/image policy and secret checks. Detailed merge/conflict evidence and limitations: https://git.sharedroot.net/jchapman/Immich-Bridge/issues/14#issuecomment-175. Native Forgejo AMD64/ARM64 release validation remains queued; no release images or deployment are claimed. This issue remains open for its pilot checkpoint. Verify the deployed owner Stop lifecycle and cleanup confirmation while retaining accepted ZIPs and already imported assets. No active upload/task or pilot service was interrupted.
Author
Owner

Final development handoff: PR #17 is merged into main in 8230741, preserving feature commit(s) e980c37.

Owner-scoped Stop covers queued/running analysis, preview and import. Queued analysis is fenced before claim; running tasks remain Stopping until worker exit and cleanup are confirmed. Repeated/late requests are safe, completion can win, cleanup uncertainty is Interrupted, and ZIPs/already imported assets remain without automatic replay.

Validation: Owner-isolation, queued/running cancellation, completion-race and runner race tests passed, alongside actual Docker cleanup and browser confirmation/Stopping checks. The combined application also passed backend/vet/race, UI lint/build, container/HTTPS, source/image policies and secret checks; integration evidence.

Documentation is updated on main through PR #21, merge 5ed7191: feature guide, merged scope/evidence, and remaining pilot checks. All nine documentation/policy tests and link/anchor/workflow checks passed.

Closing at the owner's explicit request after merge, local validation and documentation review. This supersedes the earlier request to keep this development issue open through deployment. Native Forgejo AMD64/ARM64 release gates, coordinated idle installation and applicable real-provider/owner pilot checks remain in the release checklist and coordination issue #14. No deployment, native ARM64 pass, real-library capacity result or gate waiver is claimed. PR #19 and scanning remain on hold.

Final development handoff: [PR #17](https://git.sharedroot.net/jchapman/Immich-Bridge/pulls/17) is merged into main in `8230741`, preserving feature commit(s) `e980c37`. Owner-scoped Stop covers queued/running analysis, preview and import. Queued analysis is fenced before claim; running tasks remain Stopping until worker exit and cleanup are confirmed. Repeated/late requests are safe, completion can win, cleanup uncertainty is Interrupted, and ZIPs/already imported assets remain without automatic replay. Validation: Owner-isolation, queued/running cancellation, completion-race and runner race tests passed, alongside actual Docker cleanup and browser confirmation/Stopping checks. The combined application also passed backend/vet/race, UI lint/build, container/HTTPS, source/image policies and secret checks; [integration evidence](https://git.sharedroot.net/jchapman/Immich-Bridge/issues/14#issuecomment-175). Documentation is updated on main through [PR #21](https://git.sharedroot.net/jchapman/Immich-Bridge/pulls/21), merge `5ed7191`: [feature guide](https://git.sharedroot.net/jchapman/Immich-Bridge/src/branch/main/docs/results.md#task-activity-and-stopping), [merged scope/evidence](https://git.sharedroot.net/jchapman/Immich-Bridge/src/branch/main/docs/integration-status.md), and [remaining pilot checks](https://git.sharedroot.net/jchapman/Immich-Bridge/src/branch/main/docs/deployment.md#merged-pilot-feature-checks). All nine documentation/policy tests and link/anchor/workflow checks passed. Closing at the owner's explicit request after merge, local validation and documentation review. This supersedes the earlier request to keep this development issue open through deployment. Native Forgejo AMD64/ARM64 release gates, coordinated idle installation and applicable real-provider/owner pilot checks remain in the release checklist and coordination issue #14. No deployment, native ARM64 pass, real-library capacity result or gate waiver is claimed. PR #19 and scanning remain on hold.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jchapman/Immich-Bridge#8
No description provided.