Skip to content

chore: use available sync hooks from @comapeo/core-react#1091

Merged
achou11 merged 1 commit intodevelopfrom
ac/use-sync-hooks-from-core-react
Apr 15, 2025
Merged

chore: use available sync hooks from @comapeo/core-react#1091
achou11 merged 1 commit intodevelopfrom
ac/use-sync-hooks-from-core-react

Conversation

@achou11
Copy link
Copy Markdown
Member

@achou11 achou11 commented Apr 9, 2025

Towards #1081 (specifically simplifying the useActiveProject() hook).

There should be no user-facing changes with this, as the implementation from core-react is directly ported from the implementation that was here.

There are some methods related to sync that are used in the app that haven't been ported to core-react just yet, but wouldn't consider this a blocker since they don't rely on query invalidations right now.

Also adds a unit test for a helper function related to sync state.

@achou11 achou11 force-pushed the ac/use-sync-hooks-from-core-react branch 2 times, most recently from e1daad4 to caa30f1 Compare April 9, 2025 20:33
@achou11 achou11 force-pushed the ac/use-sync-hooks-from-core-react branch from caa30f1 to 27ff047 Compare April 14, 2025 15:22
@achou11 achou11 requested a review from cimigree April 14, 2025 22:00
Copy link
Copy Markdown
Contributor

@cimigree cimigree left a comment

Choose a reason for hiding this comment

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

Everything from the old useSyncState seems to be removed, and I see the new useSyncState({ projectId }) from @comapeo/core-react is replacing it. The new test for getConnectedPeersCount covers the logic well as far as I can tell. I don’t see any stray references to the old sync code or manual query invalidations, so it all looks clean. I can’t actually test the Sync UI right now, but from reading through these diffs, the code looks straightforward and consistent.

@achou11 achou11 merged commit aa61627 into develop Apr 15, 2025
9 checks passed
@achou11 achou11 deleted the ac/use-sync-hooks-from-core-react branch April 15, 2025 17:48
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.

2 participants