0.5.0-pre.26 - stop list duplication on sync
Pre-release
Pre-release
Fix
Lists no longer duplicate after every sync ("4 lists become 8, then 12").
Root cause
A three-way race between pull, our own file writes, and the vault event handler:
- Pull replaces `localBoard.lists` wholesale with fresh uids where needed.
- pullCards then calls `writeCardFile` per refreshed card (pre.22 addition), triggering vault modify events.
- Those events hit the 250ms folder-sync debounce, which runs `reconcileListsFromIndex`.
- `reconcileListsFromIndex` reads the stale index file's list meta (pull never rewrites it), sees uids that don't exist in current `board.lists`, and re-creates them as empty lists.
Result: every sync resurrects the previous generation of list uids, so a 4-list remote board becomes 8 locally, then 12, etc.
Fix
At the end of pull, re-run `writeBoardIndexFile` for every bound board, wrapped in the plugin's `reconciling` guard so our own writes don't fire the folder-sync debounce a second time. This keeps the on-disk list meta in lockstep with in-memory `data.boards`, making `reconcileListsFromIndex` a no-op after the vault event fires.
Test
- Update via BRAT to 0.5.0-pre.26
- Sync now → the extra empty lists should collapse back to the real 4 (they were dropped in memory by pull all along; they came back only via the vault event)
- Sync again → count stays stable at 4