-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: transcript race condition #999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a retry-transcription API route, updates the transcript UI to expose a retry button for eligible users, adjusts transcript fetching noise (removes a log), expands transcribeVideo with retry-aware prechecks and error classification, and reorders an interface property in get-status without behavioral changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant UI as Transcript Tab (UI)
participant API as POST /api/videos/:id/retry-transcription
participant DB as DB (videos)
participant ISR as Revalidate Path
U->>UI: Click "Retry Transcription"
UI->>API: POST with videoId
API->>API: Auth & ownership checks
API->>DB: Update transcriptionStatus = null
API->>ISR: revalidatePath(/s/:id)
API-->>UI: { success: true, message }
note over UI: Invalidate transcript query
sequenceDiagram
autonumber
participant WRK as Transcription Worker
participant TR as transcribeVideo(videoId, userId, ..., isRetry)
participant VOD as Signed Video URL (HEAD)
participant DB as DB (videos)
participant ST as Storage (VTT)
WRK->>TR: Invoke (isRetry may be true)
TR->>VOD: HEAD check availability
alt Not ready / inaccessible
TR->>DB: Set transcriptionStatus = null
TR-->>WRK: { ok: false, message: "Video not ready - will retry" }
else Ready
TR->>TR: Generate transcription
alt Silent / empty
TR->>ST: Upload empty valid WEBVTT
else With utterances
TR->>ST: Upload WEBVTT
end
TR->>DB: Set transcriptionStatus = "COMPLETE"
TR-->>WRK: { ok: true }
end
opt Error during transcription
TR->>TR: Classify error (temporary vs permanent, using isRetry/message)
alt Temporary
TR->>DB: Set transcriptionStatus = null
TR-->>WRK: { ok: false, retryable }
else Permanent
TR->>DB: Set transcriptionStatus = "ERROR"
TR-->>WRK: { ok: false, permanent }
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Improvements
Bug Fixes