Fix: Zero mutators OCR/transcript missed follow-ups#431
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 52 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes enhance mutator field handling by excluding workflow-derived shell fields ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR fixes a race condition where concurrent user edits via Confidence Score: 5/5Safe to merge — all changes are targeted, well-justified, and covered by new tests. No P0/P1 findings. The destructuring fix in No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Add missed OCR/transcript Zero mutator f..." | Re-trigger Greptile |
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/lib/zero/mutators.ts">
<violation number="1" location="src/lib/zero/mutators.ts:359">
P1: Keeping `processingStatus` in the shared upsert payload allows unrelated audio edits to overwrite workflow-owned status during concurrent updates. Restrict this field to explicit status-transition paths instead of writing it on every upsert.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| // A concurrent user edit whose mutator tx snapshots a pre-completion | ||
| // `"processing"` value before the workflow commits `"complete"` would | ||
| // otherwise overwrite the workflow's write when the mutator upserts the | ||
| // shell. `processingStatus` is intentionally *not* stripped here because |
There was a problem hiding this comment.
P1: Keeping processingStatus in the shared upsert payload allows unrelated audio edits to overwrite workflow-owned status during concurrent updates. Restrict this field to explicit status-transition paths instead of writing it on every upsert.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/lib/zero/mutators.ts, line 359:
<comment>Keeping `processingStatus` in the shared upsert payload allows unrelated audio edits to overwrite workflow-owned status during concurrent updates. Restrict this field to explicit status-transition paths instead of writing it on every upsert.</comment>
<file context>
@@ -351,20 +351,23 @@ export async function upsertItem(
// otherwise overwrite the workflow's write when the mutator upserts the
- // shell. `syncExtractedRow` rebuilds all derived fields server-side from
- // the real extracted row.
+ // shell. `processingStatus` is intentionally *not* stripped here because
+ // the audio retry flow (WorkspaceContent.tsx handleAudioComplete) goes
+ // through this path to flip audio back to `"processing"` after a user
</file context>
This PR applies the follow-up missed by PR #425's merge, addressing a race condition where concurrent user edits could overwrite workflow-owned
ocrStatus/processingStatusfields, and adds coverage for whensyncExtractedRowruns on items without existing extracted rows.Mutator fixes
ocrStatusandprocessingStatusfromupsertItempayload; these are workflow-owned and should not be clobbered by client-side mutators that can't seeworkspace_item_extracted.updatedAtinsyncExtractedRowto avoid duplicate timestamp generation.Test coverage
ocrStatus/processingStatusto Zero and that user-editable fields flow through correctly; add test forsyncExtractedRowcreating extracted row when missing.Summary by CodeRabbit
Release Notes
Bug Fixes
Tests