Repository navigation
chore: red proof for #9144 — do not merge - #9147
Closed
waleedlatif1 wants to merge 6 commits into
Closed
waleedlatif1 wants to merge 6 commits into
waleedlatif1 wants to merge 6 commits into
Conversation
Deleting an account hard-deletes its solely-owned workspaces, and the cascade takes each in-flight run's workflow and execution log with it. A run caught in that window kept executing, then failed every terminal write: completion threw "Workflow log not found", the cost-only fallback failed the same way, run counts threw and logged twice, pause persistence logged errors, and the admission reservation leaked until its TTL. A run whose log insert failed on the deleted workspace kept executing blocks with no log row, so nothing could record or stop it. Along the way a file upload failure surfaced raw Drizzle SQL and bound parameters (user id, workspace id, storage key) in a block error. - ExecutionScopeDeletedError (no cause) marks the outcome; classifyFailure attributes it to the owner, so it logs at info. - completeWorkflowExecution, when the log row is missing, checks the run's workspace by primary key (inside the completion transaction when the row vanished mid-completion) and throws the typed error before any redaction, storage, or billing work. A missing row under a live workspace still throws "Workflow log not found" as before. - LoggingSession recognizes it in every completion path: info instead of error, no cost-only fallback, admission slot released, later completions and force-fails become no-ops, and getDeletedScope() reports it. - A log start that fails on a foreign key checks whether the workspace or workflow still exists; if not, safeStart returns false without the fallback, releases the slot, and executeWorkflowCore stops before building the executor. Any other start failure behaves exactly as before. - Run counts skip a deleted scope, and a zero-row update is an info no-op. - Pause persistence returns quietly for a deleted scope. - User-visible error text never carries a query failure's SQL: the execution upload wrapper keeps its cause and redacts its message, the block executor redacts any query failure in the cause chain, and the workspace file, file-output, video, image, TTS, ElevenLabs, LaTeX, and pause sites use a shared getUserFacingErrorMessage.
- Rename the integration suite to scope-deleted.integration.ts so its name does not repeat its folder (check:file-names). - Type the new execution-core tests through ExecutionSnapshot and LoggingSession instead of `as any` (check:explicit-any). - Define FOREIGN_KEY_VIOLATION once in database-query-error and import it in the logger and the logging session. - Cover the guards the first commit left untested: a minimal fallback start that hits the deleted scope's foreign key, a cost-only fallback that is the first to find the workspace deleted, and pause persistence skipping a run whose deletion its paused completion found. - Give the csv-workflow-execution live test's LoggingSession stub the new getDeletedScope method. Correction to the previous commit message: pause persistence is quiet only when the paused completion itself found the workspace or workflow deleted. A deletion that lands after the paused log was written still fails persistPauseResult, which logs at error and force-fails the run, exactly as before. The TSDoc now says so.
…ed workspaces - The file-output wrapper in FileToolProcessor keeps the original failure as its cause, so diagnostics and the tool boundary still see a database failure underneath the redacted message. - recordExecutionUsage logs a missing workflow at info, not error, when the run's whole workspace is gone. The completion then reports the deleted run. The lookup runs only on that missing-workflow branch, both branches record nothing as before, and a failed lookup or a live workspace keeps the error.
Fold the deleted-scope note and slot release into one session helper, reuse the admission-slot release on the normal completion path, share an ExecutionScope type, drop the unread executionId field and a redundant guard.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This branch was previously deployed
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.
Throwaway: #9144 with its production guards reverted, tests kept, to prove
scope-deleted.integration.tsfails without the fix. Will be closed and deleted.