Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Warning Review limit reached
More reviews will be available in 18 minutes and 21 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
✨ 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 |
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
@copilot review but do not make fixes |
d87ec57 to
aaa1efe
Compare
|
@copilot review but do not make fixes |
aaa1efe to
cad6af6
Compare
|
Addressed Greptile review comment 3328291076 by removing the unbounded Math.max spread and adding a 70,000-row same-db_version regression test. @copilot review but do not make fixes |
cad6af6 to
6988a73
Compare
6988a73 to
9dccf9e
Compare
Fixes ADE-47
Summary
Describe the change.
What Changed
Key files and behaviors.
Validation
How you tested.
Risks
Anything to watch.
Linked Linear issues
Greptile Summary
This PR fixes ADE-47, where CRR sync silently dropped rows when a changeset batch was cut in the middle of a
db_versiongroup. It also removes the priorMath.max(...spread)call that could throw aRangeErroron largedb_versiongroups.syncHostService.ts): Extracts a new exportedselectChangesetBatchChunkfunction that delays the chunk boundary until adb_versiontransition, ensuring all rows sharing onedb_versionare sent together.toDbVersionis now tracked directly vialastIncludedDbVersionrather than a spread intoMath.max.syncHostService.test.ts): Four new unit tests cover row-limit splitting, byte-limit splitting, 70k-row single-version batches, and empty-changeset advancement.db_versionmust not be split across separate host batches.Confidence Score: 4/5
Safe to merge; the core fix is correct and well-tested, with one unreachable fallback branch that can be cleaned up post-merge.
The chunk-selection logic correctly defers breaks to db_version boundaries and tracks the watermark directly via
lastIncludedDbVersion. The only issue is a now-unreachable three-line fallback (lines 232–234) that was a safety valve in the old code but can never trigger under the new loop invariant.apps/ade-cli/src/services/sync/syncHostService.ts — minor dead-code cleanup around the single-row fallback.
Important Files Changed
selectChangesetBatchChunkfunction, which fixes the split-db_version bug by deferring the break to the next db_version boundary; contains one unreachable fallback branch (lines 232–234).selectChangesetBatchChunkcovering row-limit splitting, byte-limit splitting, the 70k-row no-spread case, and empty-changeset advancement.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["selectChangesetBatchChunk(changes, fromDbVersion, toDbVersion, maxRows, maxBytes)"] --> B{changes empty?} B -- yes --> C{toDbVersion > fromDbVersion?} C -- no --> D["return null"] C -- yes --> E["return { changes: [], toDbVersion }"] B -- no --> F["Iterate over sorted changes"] F --> G{chunk.length > 0\nAND new db_version\nAND row/byte limit hit?} G -- yes --> H["break — db_version boundary respected"] G -- no --> I["push row to chunk\nupdate lastIncludedDbVersion"] I --> F H --> J["return { changes: chunk, toDbVersion: lastIncludedDbVersion }"] I --> JPrompt To Fix All With AI
Reviews (5): Last reviewed commit: "fix(sync): keep changeset batches on db ..." | Re-trigger Greptile