Skip to content

fix(app): clear orphan queued compiles after cancel#119

Merged
tuirk merged 1 commit into
mainfrom
fix/compile-session-cancel-gate
Jun 4, 2026
Merged

fix(app): clear orphan queued compiles after cancel#119
tuirk merged 1 commit into
mainfrom
fix/compile-session-cancel-gate

Conversation

@tuirk
Copy link
Copy Markdown
Owner

@tuirk tuirk commented Jun 4, 2026

Summary

  • Auto-cancel other never-started queued compile sessions when starting a new onboarding finalize (orphans left after failed n8n triggers no longer block the global gate).
  • Keep cancelled sessions cancelled: pipeline step updates cannot resurrect cancelledrunning.
  • Reject /api/compile/run on already-cancelled rows; review UI names the blocking active_session_id on 409.

Root cause

Cancelling one session only flips that session_id to cancelled. A different session still queued or running holds the single-compile gate — common after n8n_unreachable orphans or starting a new run right after cancel.

Test plan

  • cd app && npm test -- src/__tests__/supersede-orphan-queued.test.ts (3/3)
  • CI integration + unit jobs green
  • Manual: cancel compile → new onboarding finalize without manual orphan cancel

Root cause: cancelled sessions left other queued/running rows holding the global gate; orphan queued rows after n8n trigger failures blocked new runs.

Investigation: activity_log showed cancel on session A while session B stayed active; supersedeOrphanQueuedSessions + cancelled-status guard in pipeline.

Test: app/src/__tests__/supersede-orphan-queued.test.ts
Signed-off-by: tuirk <65666288+tuirk@users.noreply.github.com>
@tuirk tuirk requested a review from ahjinsolo as a code owner June 4, 2026 08:28
@tuirk tuirk merged commit 8f16a0b into main Jun 4, 2026
9 checks passed
@tuirk tuirk deleted the fix/compile-session-cancel-gate branch June 4, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant