Skip to content

Commit 09b67a5

Browse files
committed
fix(octane): install COMMIT_WORK when store-sync drain is first registered
enqueueStoreSync pushes onto storeSyncQueue but relied on the companion useEffect in useSyncExternalStore to install COMMIT_WORK via installEffectDrivers. In a hidden-from-start Activity the effect enrollment is skipped (inInactiveSubtree early return), so COMMIT_WORK was never set. The commitEffects fast path then short-circuited past the queue drains, leaving inst.queued true permanently and hasScheduledWork stuck.
1 parent fb41716 commit 09b67a5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎packages/octane/src/runtime/engine.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ import {
126126
MANUAL_HOOK_DRIVER,
127127
noop,
128128
COMMIT_WORK,
129+
installCommitWork,
129130
EFFECT_HOOKS,
130131
} from './drivers.js';
131132
import {
@@ -4589,6 +4590,7 @@ export function useSyncExternalStore<T>(
45894590
const scope = CURRENT_SCOPE!;
45904591
let inst = scope.hooks?.get(subs.inst) as StoreInst<T> | undefined;
45914592
if (inst === undefined) {
4593+
installCommitWork();
45924594
drainStoreSyncs = drainQueuedStoreSyncs;
45934595
// MOUNT — create the stable cell once (useEffectEvent's mount-once pattern).
45944596
// forceUpdate schedules the block directly (identical to a useState setter,

0 commit comments

Comments
 (0)