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:
2026-07-13 10:34:44 +08:00
parent 6f01a29723
commit 3137970b97
4 changed files with 26 additions and 7 deletions
+4
View File
@@ -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;
}