feat: rebuild reactivity state from store after replay
Add `rebuildReactivityFromStore` to synchronize local reactivity state with the hydrated variable store. This ensures tag activations are correctly tracked following a reducer replay. Also remove the unused `invalidateCompletions` function.
This commit is contained in:
@@ -14,6 +14,7 @@ import { createSignal } from "solid-js";
|
||||
import * as Comlink from "comlink";
|
||||
import type { StreamMessage } from "../journal/registry";
|
||||
import { getMessageType, validatePayload } from "../journal/registry";
|
||||
import { rebuildReactivityFromStore } from "../journal/var-reactivity";
|
||||
import type { WorkerState, WorkerPatch, SessionManifest } from "../../workers/journal.worker";
|
||||
import type { JournalWorkerAPI } from "../../workers/journal.worker";
|
||||
import {
|
||||
@@ -162,6 +163,9 @@ function handlePatch(patch: WorkerPatch): void {
|
||||
saveRole(patch.state.myRole);
|
||||
// Rebuild derived state (revealedPaths, variables) by replaying reducers
|
||||
replayReducers();
|
||||
// Rebuild local reactivity engine state so tag activations from
|
||||
// hydrated variables are tracked for subsequent cascade computations.
|
||||
rebuildReactivityFromStore(state.variables);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user