refactor(sync): batch untracked board graduation via MARK_BOARDS_SYNCED#2212
Merged
Conversation
Untracked-board graduation in Pass 2 of classifyBoardsForPush previously dispatched updateBoard(board, true) per board, which rewrites the boards array and recomputes lastEdited on every graduation even though the board data never changes. Introduce a dedicated MARK_BOARDS_SYNCED action that batches all graduated board IDs into a single dispatch/reducer pass, only flipping syncMeta[id].status to SYNCED without touching the boards array. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tomivm
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the per-board
dispatch(updateBoard(b, true))used to graduate untracked boards in Pass 2 ofclassifyBoardsForPushwith a single batchedMARK_BOARDS_SYNCEDaction.Closes #2211
Why
Graduation onboards an untracked board into the sync system when a same-ID remote board exists with an equal-or-newer
lastEdited. The board's data never changes — the only meaningful effect is settingsyncMeta[id].status = SYNCED.Using
UPDATE_BOARDfor this was wasteful:boardsarray (splice) once per board,lastEdited(to the same value),Changes
Board.constants.js— newMARK_BOARDS_SYNCEDaction type.Board.actions.js— newmarkBoardsSynced(boardIds)action creator. Pass 2 now collects graduated IDs intoboardsToGraduateand dispatches a singlemarkBoardsSynced(...)before returning (dispatch kept insideclassifyBoardsForPush).Board.reducer.js— newMARK_BOARDS_SYNCEDcase that batch-setsstatus: SYNCEDfor all IDs in one reducer pass (same pattern asADD_BOARDS) and leaves theboardsarray untouched.docs/sync-engine.md— updated the graduation logic (§7) and thesyncMetalifecycle table (§10.2).Board.actions.test.js— updated the graduation test to assert the batchedMARK_BOARDS_SYNCEDaction.Scope note
Graduation of untracked boards happens only in Pass 2. The other
updateBoard(_, true)calls in the PULL phase (applyRemoteChangesToState) are genuine data updates from remote and keep usingUPDATE_BOARD.Testing
Board.actions.test.jsandBoard.reducer.test.js— 137 tests passing.🤖 Generated with Claude Code