fix: derive isComplete from isRealtime+pct instead of ponder_sync_is_complete (COW-1008)#94
Conversation
…complete (COW-1008) ponder_sync_is_complete never reaches 1 for chains with live block handlers (C1–C5 run indefinitely). isComplete is now computed locally as isRealtime && pct >= 100, which correctly reflects sync completion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
lgahdl
left a comment
There was a problem hiding this comment.
Review: COW-1008 — Fix isComplete
Code Quality: PASS — One-line fix with an inline comment explaining the root cause. The comment makes the workaround self-documenting for future maintainers.
Coherence: PASS — Directly addresses the bug: ponder_sync_is_complete never reaches 1 because C1-C5 live block handlers run indefinitely. The local derivation (isRealtime && pct >= 100) is the correct signal for 'all historical blocks processed and now receiving live blocks'.
Functionality: PASS — The test suite now covers the regression: a chain where ponder_sync_is_complete=0 but isRealtime=1 and pct=100 correctly returns isComplete=true. The existing case where isRealtime=1 but pct<100 correctly returns isComplete=false.
|
Superseded by #102 ( |
Summary
ponder_sync_is_completenever reaches1for chains with live block handlers (C1–C5 run indefinitely after historical sync ends)isCompleteis now computed locally asisRealtime && pct >= 100, which correctly reflects that indexing is fully caught upisComplete=truewhenponder_sync_is_complete=0butisRealtime=1and all blocks processedTest plan
pnpm test tests/api/sync-progress.test.ts— 8 tests, all passpnpm typecheck— clean/api/sync-progresson staging after deploy; confirmisCompleteflips totrueonceisRealtime=trueandhistoricalBlocksFetchedPct=100🤖 Generated with Claude Code