Commit 490d519
fix(persistence): allow leader to process coordinator-delivered tx:committed messages
The leader tab's `onCoordinatorMessage` handler skipped ALL messages
where `senderId` matched the coordinator's own node ID. But when the
coordinator processes a follower's RPC in `handleApplyLocalMutations`,
it delivers the resulting `tx:committed` to local subscribers using the
coordinator's own `senderId`. This caused the leader's runtime to
silently ignore follower mutations — they were written to SQLite but
never applied to the leader's in-memory collection.
Fix: Allow `tx:committed` messages from self to pass through the filter.
The seq dedup logic in `processCommittedTxUnsafe` already prevents
double-processing: when the leader's own mutations go through the
coordinator, `observeStreamPosition` is called with the response's
term/seq before the local `tx:committed` delivery runs under the mutex,
so the duplicate is detected via `txCommitted.seq <= this.latestSeq`.
Other message types (heartbeats, resets) from self are still skipped.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent d046bee commit 490d519
1 file changed
Lines changed: 9 additions & 4 deletions
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1581 | 1581 | | |
1582 | 1582 | | |
1583 | 1583 | | |
1584 | | - | |
1585 | | - | |
1586 | | - | |
1587 | | - | |
1588 | 1584 | | |
| 1585 | + | |
1589 | 1586 | | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1590 | 1590 | | |
1591 | 1591 | | |
1592 | 1592 | | |
| |||
1601 | 1601 | | |
1602 | 1602 | | |
1603 | 1603 | | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
1604 | 1609 | | |
1605 | 1610 | | |
1606 | 1611 | | |
| |||
0 commit comments