Repository navigation
Convert subscriptions to useSyncExternalStore (bd-06s9sufx) - #925
Merged
shikokuchuo merged 1 commit intoOct 27, 2026
Merged
shikokuchuo merged 1 commit into
shikokuchuo merged 1 commit into
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
- useDocBranches: replace version-bump re-render with useSyncExternalStore over new memoized per-path branchService snapshots (getBranchSnapshot) — the one site that could actually tear under concurrent rendering - usePreference: convert the custom-event subscription; the writer's local echo was redundant (setPreference dispatches synchronously) - usePresence: convert onPresenceChange; presenceService now memoizes getRemotePresences on a version bumped before the visibility gate, so data freshness is never deferred, only notifications - Add shared useNow(intervalMs) (one ticking store per interval) and useOnlineStatus() hooks; replace the duplicated 1s ticker + online/ offline blocks in SyncStatusBadge and ConnectionStatusDialog - Document the intentional polling in DebugInspectorPanel (debug-only) Characterization tests pinned first for the uncovered sites (useDocBranches, ConnectionStatusDialog). Phase 2 of claude-notes/plans/2026-10-24-hub-client-useeffect-refactor.md.
shikokuchuo
force-pushed
the
refactor/bd-06s9sufx-useeffect-phase2
branch
from
October 27, 2026 11:50
fccb7c9 to
c2096bc
Compare
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.
Stacked on #924. Phase 2 of
claude-notes/plans/2026-10-24-hub-client-useeffect-refactor.md.useDocBranches,usePreference, andusePresencetouseSyncExternalStore.branchServiceandpresenceServicesogetSnapshotstays stable between changes.useNowanduseOnlineStatushooks; use them inSyncStatusBadgeandConnectionStatusDialogin place of duplicated ticker and online/offline effects.DebugInspectorPanel.This fixes a possible tearing bug in
useDocBranchesunder concurrent rendering. The other conversions are simplifications. No user-visible change, so no changelog entry.Tests: full
npm run test:cigreen (1720 unit, 225 integration, 434 WASM) andnpm run buildgreen. Characterization tests were pinned before each refactor.