Skip to content

Conversation

@tomivm
Copy link
Collaborator

@tomivm tomivm commented Jan 22, 2026

Enhance board synchronization by implementing the syncBoards action, updating the reducer to manage sync status, and refining board identification logic. This update improves the handling of locally created boards and integrates detailed synchronization states. Tests have been adjusted to ensure accuracy in board classification and synchronization processes.

NOTE: The original descriptionwas EDITED

Close #2096

@tomivm tomivm marked this pull request as ready for review January 23, 2026 22:58
RodriSanchez1 and others added 11 commits January 26, 2026 18:08
…ation (#2098)

* Add UPDATE_BOARDS_AFTER_RECONCILE action and handle in boardReducer

* Add UPDATE_BOARDS_AFTER_RECONCILE action and update syncBoardsSuccess logic

* Rename functions to better reflect their purpose and update related tests

* Refactor syncBoardsSuccess test to remove unnecessary boards assignment
…RECONCILE action and updating reconcileAndMergeBoards to return detailed board states.
…andling and soft delete functionality in the reducer
@tomivm
Copy link
Collaborator Author

tomivm commented Feb 4, 2026

I use Claude Code to review the changes and I get:

  1. ADD_BOARDS missing syncStatus (Board.reducer.js:134-138)
    - Boards from server are added without syncStatus, causing inconsistent behavior
    - Should default to SYNC_STATUS.SYNCED for remote boards
  2. Incorrect axios error property (Board.actions.js:638, 685)
    - Uses e.status instead of e.response?.status
    - 404 errors won't be properly detected
  3. Dead/incomplete code in applyRemoteChangesToState (Board.actions.js:629-643)
    - Commented-out dispatch logic
    - No handling when API.getBoard() succeeds

Important Issues (Should Fix)

  1. Missing tests for syncBoards and applyRemoteChangesToState - the core sync logic
  2. Sequential API calls could be parallelized with Promise.allSettled (not sure maybe intentional)

What's Done Well

  • Clear PULL-then-PUSH architecture
  • Good test coverage (111 tests pass)
  • Proper syncStatus and isSyncing state tracking
  • Well-documented functions with JSDoc
  • Clean selectors with tests

Recommendations

  1. Fix axios error property access
  2. Handle syncStatus in ADD_BOARDS
  3. Clean up the commented code block
  4. Add the missing orchestration tests

*/
export function applyRemoteChangesToState(
newRemoteBoards,
remoteNewerBoards,
Copy link
Collaborator Author

@tomivm tomivm Feb 4, 2026

Choose a reason for hiding this comment

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

this names are confusing me

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you have any suggestion?

continue;
}

if (moment(remote.lastEdited).isAfter(local.lastEdited)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what happen if local is newer ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the local board is newer will be pushed to the api as it gonna have the syncStatus: pending state

applyRemoteChangesToState(
newRemoteBoards,
remoteNewerBoards,
remoteDeletedBoardIds
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i think would be great to use a object for params of this function. same for classifyRemoteBoards.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thats a good idea

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.

Implement syncBoards function for board synchronization

2 participants