fix: recording fallback tracks all untracked recordings#6960
Conversation
…hans Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c44ee0a565
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| linkAttachmentToMessage(persistedMessage.id, attachment.id, 0); | ||
| recordingTracked = true; |
There was a problem hiding this comment.
Mark recording tracked before linking attachment
recordingTracked is only flipped after linkAttachmentToMessage(...), but the file is already tracked once createFileBackedAttachment(...) succeeds. If linking throws (for example from a transient DB write/constraint issue), this leaves recordingTracked false and the fallback path creates a second attachment row for the same recording, which can produce duplicate attachment records and duplicate cleanup processing for one file.
Useful? React with 👍 / 👎.
…hans (#6960) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…hans (#6960) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…hans (#6960) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…hans (#6960) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…hans (#6960) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…hans (#6960) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
When reportToSessionId exists but conversation is missing or summary is empty, the recording file was left untracked on disk. The orphan fallback only ran when !meta?.reportToSessionId, missing this edge case. Changed to use a recordingTracked flag so the fallback catches all untracked recordings. Added tests for both edge cases.