Skip to content

fix: derive isComplete from isRealtime+pct instead of ponder_sync_is_complete (COW-1008)#94

Closed
lgahdl wants to merge 1 commit into
developfrom
luizhatem/cow-1008-fix-api-sync-progress-returns-iscomplete-false
Closed

fix: derive isComplete from isRealtime+pct instead of ponder_sync_is_complete (COW-1008)#94
lgahdl wants to merge 1 commit into
developfrom
luizhatem/cow-1008-fix-api-sync-progress-returns-iscomplete-false

Conversation

@lgahdl

@lgahdl lgahdl commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ponder_sync_is_complete never reaches 1 for chains with live block handlers (C1–C5 run indefinitely after historical sync ends)
  • isComplete is now computed locally as isRealtime && pct >= 100, which correctly reflects that indexing is fully caught up
  • Added regression test: verifies isComplete=true when ponder_sync_is_complete=0 but isRealtime=1 and all blocks processed

Test plan

  • pnpm test tests/api/sync-progress.test.ts — 8 tests, all pass
  • pnpm typecheck — clean
  • Hit /api/sync-progress on staging after deploy; confirm isComplete flips to true once isRealtime=true and historicalBlocksFetchedPct=100

🤖 Generated with Claude Code

…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>
@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

COW-1008

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtsx@​4.22.31001008293100

View full report

@lgahdl lgahdl left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lgahdl lgahdl changed the base branch from main to develop June 16, 2026 02:32
@jeffersonBastos

Copy link
Copy Markdown
Contributor

Superseded by #102 (final-qadevelop). Verified that this PR's changes (COW-1008) are fully contained in the consolidated final-qa branch. Closing to merge everything through the single QA branch per the agreed plan — no work is lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants