chore: revalidate path on transcription generation#993
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a server-side cache revalidation call after successful AI metadata generation and adjusts client-side Share page loading logic by broadening AI-loading conditions and removing automatic refetch-on-focus/mount behavior. No public APIs or signatures changed; error paths and overall control flow remain otherwise unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant SP as Share Page (Client)
participant VQ as useVideoStatus (React Query)
participant GS as get-status (Server Action)
participant AI as AI Metadata Generator
participant NX as Next.js Cache
U->>SP: Open /s/:videoId
SP->>VQ: Start polling (interval-based)
VQ->>GS: get-status(videoId)
GS->>AI: Check AI generation state
alt AI metadata just completed successfully
AI-->>GS: Success + new metadata
GS->>NX: revalidatePath(/s/:videoId)
NX-->>GS: Path revalidated
else In-progress or unchanged
AI-->>GS: Processing / No update
end
GS-->>VQ: Status + aiData
VQ-->>SP: Update UI
note over SP: Loading shown if aiGenerationEnabled and (aiData.processing OR no AI fields)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
✨ 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 |
This PR makes sure the UI actually updates with the AI transcription generated.
Summary by CodeRabbit