Skip to content

fix(indexer): always write the resume point to _index_state row 1 - #76

Merged
lucca65 merged 2 commits into
masterfrom
fix/index-state-singleton-row
Sep 27, 2026
Merged

lucca65 merged 2 commits into
masterfrom
fix/index-state-singleton-row

Conversation

@lucca65

@lucca65 lucca65 commented Sep 27, 2026

Copy link
Copy Markdown
Member

On a DB without _index_state row id=1, updateIndexState save()d a row without an id → one new serial row per action block, id=1 never existed, and every restart replayed from block 1 (seen locally). Now an explicit upsert of row 1. Prod already has row 1 → no behaviour change there. Upsert SQL verified on a temp table with an advanced serial.

🤖 Generated with Claude Code

lucca65 and others added 2 commits September 27, 2026 22:22
demux loads the resume point from _index_state id=1 only. Our
updateIndexState did findOne({id: 1}) || {} and save()d the result, so on
a database without that row every action block inserted a new serial
row, id=1 never appeared, and every restart replayed from block 1. Upsert
row 1 explicitly. Prod already has row 1, so its behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lucca65
lucca65 merged commit 86e789a into master Sep 27, 2026
2 checks passed
@lucca65
lucca65 deleted the fix/index-state-singleton-row branch September 27, 2026 21:03
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.

1 participant