fix(sync): send known personal record IDs on pull - #705
Conversation
Empty personalRecordIds forced the portal to page PRs by cursor only. When many PRs share one microsecond timestamp, that cursor loops and the client aborts after 4 pages. Send local PR UUIDs (and IDs merged earlier in the same pull) so get_personal_records_excluding_ids can advance and tombstones can actually be fetched. Related to phoenix-portal#97.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge The single Ponytail finding from the previous pass — Oh wait, this commit is actually clean. I had my flamethrower warmed up for a regression review and the author went and fixed the thing. Rude, but appreciated. 🏆 Best part: Surgical hoist — 💀 Worst part: There is genuinely nothing wrong with this commit. It's 4 lines changed and the only one I'd quibble about is the comment that justifies the hoist (which is actually fine because future-you will wonder why this variable exists). Strong 🥱 — the best kind of bug. 📊 Overall: Like a decaf espresso — technically wrong by spec, but exactly what the room needed. Files Reviewed (1 file in incremental diff)
Previous Review Summary (commit 8d67bd6)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 8d67bd6)Verdict: Approve | Recommendation: Merge after optional cleanup Overview
Issue Details (click to expand)
🏆 Best part: The fix itself is surgical and correct — sending canonical PR UUIDs lets the portal advance the cursor and unlocks 💀 Worst part: Four 📊 Overall: Like a pulled-pork sandwich that arrives on a paper plate — the meat is correct, the fix lands, and the only nitpick is that someone plated it four times before handing it to you. Correctness / Safety FindingsNo correctness or safety findings. The pagination fix matches the linked portal issue ( Ponytail Review
Ponytail net: -2 lines. Suggested Minimal PatchCompute val entityIds = currentKnownEntityIds()
Logger.i("SyncManager") {
"Parity sync: sending ${entityIds.sessionIds.size} session IDs, " +
"${entityIds.routineIds.size} routine IDs, ${entityIds.cycleIds.size} cycle IDs, " +
"${entityIds.personalRecordIds.size} personal record IDs"
}Final Merge GuidanceCan merge as-is. The single suggestion is an optional cleanup — not blocking. The pagination correctness fix should ship. Reviewed by minimax-m3 · Input: 28K · Output: 3.4K · Cached: 201.3K Review guidance: REVIEW.md from base branch |
currentKnownEntityIds() was interpolated four times in one log line.
Summary
Defense-in-depth for the portal pull cursor loop (phoenix-portal#97).
SyncManagersentpersonalRecordIds = emptyList()on every pull so the portal had to page PRs by cursor only. Combined with JS Date microsecond truncation, that loops after ~4 pages / 407 entities.The empty list also meant
get_personal_record_tombstonesnever ran.Changes
knownEntityIds.personalRecordIds.Test plan
:shared:testAndroidHostTest --tests PortalPullPaginationTest --tests SyncManagerTest— BUILD SUCCESSFULRelated to 9thLevelSoftware/phoenix-portal#97.