Skip to content

Commit eae477f

Browse files
committed
fix(signals): share the swapped-raw rule between the eager and held pairings
The rule that keeps a raw present in both frames its own row (#3712) lived only on the held first-read path (`adoptChild`); the eager `descend` paired the same record swap (`{x: A, y: B}` to `{x: B, y: A}`, both rows proxied) and aliased the two after the commit, held or not. One predicate, `ownRow`, now serves both. `descend` becomes a closure of `applyAdopt` so it reads the two frames without five call sites growing: +5 B brotli / +5 B minified on the createStore scenario over the previous commit. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_015Q7JD9PktsxtBJJbWmtuwr
1 parent cc55f36 commit eae477f

6 files changed

Lines changed: 164 additions & 71 deletions

File tree

‎packages/signals/docs/INTERNALS-STORE-STATE.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ there is nothing to diff.)
195195
is asked. Container → key → leaf is the end of this series; there is no
196196
finer unit. Not paired (the hold stands): a shallow family, a reorder (the
197197
keys differ), and a `reconcile()` in a plain setter, whose key the target
198-
does not carry.
198+
does not carry. Nor, in either pairing, a raw present in both frames — the
199+
same objects swapped or reordered (`{x: A, y: B}` to `{x: B, y: A}`): it
200+
moved, it did not change, and it is its own row (`ownRow`, the one rule
201+
`descend` and `adoptChild` share). Paired, the two would alias after the
202+
commit; unpaired, each raw keeps its target and the slots change.
199203

200204
## 4. Identity rules
201205

‎packages/signals/docs/RULES-INDEX.md‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@ Status legend: **live** stated and standing · **ruled** carries an explicit rul
124124

125125
| id | status | defined | cited in src | cited in tests | statement (at definition) |
126126
|---|---|---|---|---|---|
127-
| RUL-1 | resolved | `docs/INTERNALS-STORE-STATE.md:534` | store.ts×2 | next-smoke.test.ts×1 | - **RUL-1 — RESOLVED (2026-08-16, verified per "mirror signals if verified" — |
128-
| RUL-2 | ruled | `docs/INTERNALS-STORE-STATE.md:543` | — | createOptimisticStore.test.ts×1 | - **RUL-2 — RULED (Ryan, 2026-08-17): no landing matrix. Two orthogonal |
129-
| RUL-3 | resolved | `docs/INTERNALS-STORE-STATE.md:642` | optimistic.ts×1 | — | - **RUL-3 — RESOLVED (verified 2026-08-16).** Ownership already lives |
130-
| RUL-4 | resolved | `docs/INTERNALS-STORE-STATE.md:649` | — | optimistic-signal-refetch-hold.test.ts×1 | - **RUL-4 — RESOLVED (2026-08-17, signal parity — verified empirically).** |
131-
| RUL-5 | live | `docs/INTERNALS-STORE-STATE.md:662` | — | adoption-lane-rollback.test.ts×1 | - **RUL-5 — SPEC'D (2026-08-17): §6b.** Lane backing + lane-view/committed- |
132-
| RUL-6 | live | `docs/INTERNALS-STORE-STATE.md:666` | — | — | - **RUL-6 — reclassified: SPEC WORK, not a ruling.** Live chaining (#2941 — |
133-
| RUL-7 | live | `docs/INTERNALS-STORE-STATE.md:675` | — | — | - **RUL-7 — SPEC'D (2026-08-17): §6c.** One status field on the root target, |
134-
| RUL-8 | live | `docs/INTERNALS-STORE-STATE.md:678` | — | adoption-lane-rollback.test.ts×1 | - **RUL-8 — SPEC'D (2026-08-17): §6 rewrite, resolves O2.** Per-transaction |
135-
| RUL-9 | resolved | `docs/INTERNALS-STORE-STATE.md:681` | — | — | - **RUL-9 — RESOLVED (2026-08-17, parity by construction).** Every piece of |
136-
| RUL-10 | live | `docs/INTERNALS-STORE-STATE.md:686` | — | — | - **RUL-10 — The equality trio.** One precise rule needed spanning: no-op |
137-
| RUL-11 | live | `docs/INTERNALS-STORE-STATE.md:692` | — | — | - **RUL-11 — SPEC'D (2026-08-17): §6d.** Sticky descendants flag ported from |
138-
| RUL-12 | live | `docs/INTERNALS-STORE-STATE.md:694` | store.ts×1 types.ts×1 | createProjection.async.test.ts×1 shared-child-multiparent.test.ts×1 | - **RUL-12 — Smaller rulings, each with a proposed default** (proceeding on |
139-
| RUL-13 | resolved | `docs/INTERNALS-STORE-STATE.md:740` | — | — | - **RUL-13 — RESOLVED (verified 2026-08-16)**: `optimistic-lane-transaction- |
127+
| RUL-1 | resolved | `docs/INTERNALS-STORE-STATE.md:538` | store.ts×2 | next-smoke.test.ts×1 | - **RUL-1 — RESOLVED (2026-08-16, verified per "mirror signals if verified" — |
128+
| RUL-2 | ruled | `docs/INTERNALS-STORE-STATE.md:547` | — | createOptimisticStore.test.ts×1 | - **RUL-2 — RULED (Ryan, 2026-08-17): no landing matrix. Two orthogonal |
129+
| RUL-3 | resolved | `docs/INTERNALS-STORE-STATE.md:646` | optimistic.ts×1 | — | - **RUL-3 — RESOLVED (verified 2026-08-16).** Ownership already lives |
130+
| RUL-4 | resolved | `docs/INTERNALS-STORE-STATE.md:653` | — | optimistic-signal-refetch-hold.test.ts×1 | - **RUL-4 — RESOLVED (2026-08-17, signal parity — verified empirically).** |
131+
| RUL-5 | live | `docs/INTERNALS-STORE-STATE.md:666` | — | adoption-lane-rollback.test.ts×1 | - **RUL-5 — SPEC'D (2026-08-17): §6b.** Lane backing + lane-view/committed- |
132+
| RUL-6 | live | `docs/INTERNALS-STORE-STATE.md:670` | — | — | - **RUL-6 — reclassified: SPEC WORK, not a ruling.** Live chaining (#2941 — |
133+
| RUL-7 | live | `docs/INTERNALS-STORE-STATE.md:679` | — | — | - **RUL-7 — SPEC'D (2026-08-17): §6c.** One status field on the root target, |
134+
| RUL-8 | live | `docs/INTERNALS-STORE-STATE.md:682` | — | adoption-lane-rollback.test.ts×1 | - **RUL-8 — SPEC'D (2026-08-17): §6 rewrite, resolves O2.** Per-transaction |
135+
| RUL-9 | resolved | `docs/INTERNALS-STORE-STATE.md:685` | — | — | - **RUL-9 — RESOLVED (2026-08-17, parity by construction).** Every piece of |
136+
| RUL-10 | live | `docs/INTERNALS-STORE-STATE.md:690` | — | — | - **RUL-10 — The equality trio.** One precise rule needed spanning: no-op |
137+
| RUL-11 | live | `docs/INTERNALS-STORE-STATE.md:696` | — | — | - **RUL-11 — SPEC'D (2026-08-17): §6d.** Sticky descendants flag ported from |
138+
| RUL-12 | live | `docs/INTERNALS-STORE-STATE.md:698` | store.ts×1 types.ts×1 | createProjection.async.test.ts×1 shared-child-multiparent.test.ts×1 | - **RUL-12 — Smaller rulings, each with a proposed default** (proceeding on |
139+
| RUL-13 | resolved | `docs/INTERNALS-STORE-STATE.md:744` | — | — | - **RUL-13 — RESOLVED (verified 2026-08-16)**: `optimistic-lane-transaction- |
140140
## R — core-store (`CS-R<n>`)
141141

142142
| id | status | defined | cited in src | cited in tests | statement (at definition) |
@@ -381,19 +381,19 @@ Status legend: **live** stated and standing · **ruled** carries an explicit rul
381381
| §1 | live | `docs/INTERNALS-STORE-STATE.md:27` | target.ts×1 | reveal-gating-contract.test.ts×1 | Storage model (the single-home rule) |
382382
| §2 | live | `docs/INTERNALS-STORE-STATE.md:81` | — | — | Read paths |
383383
| §3 | live | `docs/INTERNALS-STORE-STATE.md:116` | optimistic.ts×1 reconcile.ts×1 store.ts×2 | — | Write paths (all must stay equivalent) |
384-
| §4 | live | `docs/INTERNALS-STORE-STATE.md:200` | — | — | Identity rules |
385-
| §5 | live | `docs/INTERNALS-STORE-STATE.md:212` | store.ts×1 target.ts×1 | — | Laziness invariants (candidates for `__TEST__` assertions) |
386-
| §5b | live | `docs/INTERNALS-STORE-STATE.md:230` | target.ts×2 | — | Creation budget (phase-1 fitness) |
387-
| §5c | live | `docs/INTERNALS-STORE-STATE.md:249` | — | — | Comparison method (shipped vs rewrite) |
388-
| §6 | live | `docs/INTERNALS-STORE-STATE.md:300` | target.ts×1 | — | Structural edits — the key-set node (resolves O2, RUL-8) |
389-
| §6b | live | `docs/INTERNALS-STORE-STATE.md:328` | — | adoption-lane-rollback.test.ts×1 | Lane-aware adoption (RUL-5) |
390-
| §6c | live | `docs/INTERNALS-STORE-STATE.md:347` | — | createProjection.async.test.ts×1 flight-owned-transaction.test.ts×1 | Store-wide status gating (RUL-7) |
391-
| §6d | live | `docs/INTERNALS-STORE-STATE.md:360` | reconcile.ts×2 target.ts×2 | — | Diff reachability (RUL-11) |
392-
| §7 | live | `docs/INTERNALS-STORE-STATE.md:372` | optimistic.ts×1 projection.ts×1 | — | Projections & optimism layering |
393-
| §7b | live | `docs/INTERNALS-STORE-STATE.md:382` | scheduler.ts×1 affects.ts×1 optimistic.ts×2 projection.ts×1 reconcile.ts×1 store.ts×8 target.ts×4 | optimistic-chained-revert-3672-memo.test.ts×1 optimistic-removed-prop-3883.test.ts×1 | Chained backing (cross-store) — spec |
394-
| §8 | live | `docs/INTERNALS-STORE-STATE.md:453` | — | l2-contract.test.ts×1 reconcile-resend-identity.test.ts×1 | Assumptions / open questions |
395-
| §8b | live | `docs/INTERNALS-STORE-STATE.md:509` | — | — | Suite-mined rules (2026-08-16) — index & rulings needed |
396-
| §9 | live | `docs/INTERNALS-STORE-STATE.md:745` | — | — | Decision log |
384+
| §4 | live | `docs/INTERNALS-STORE-STATE.md:204` | — | — | Identity rules |
385+
| §5 | live | `docs/INTERNALS-STORE-STATE.md:216` | store.ts×1 target.ts×1 | — | Laziness invariants (candidates for `__TEST__` assertions) |
386+
| §5b | live | `docs/INTERNALS-STORE-STATE.md:234` | target.ts×2 | — | Creation budget (phase-1 fitness) |
387+
| §5c | live | `docs/INTERNALS-STORE-STATE.md:253` | — | — | Comparison method (shipped vs rewrite) |
388+
| §6 | live | `docs/INTERNALS-STORE-STATE.md:304` | target.ts×1 | — | Structural edits — the key-set node (resolves O2, RUL-8) |
389+
| §6b | live | `docs/INTERNALS-STORE-STATE.md:332` | — | adoption-lane-rollback.test.ts×1 | Lane-aware adoption (RUL-5) |
390+
| §6c | live | `docs/INTERNALS-STORE-STATE.md:351` | — | createProjection.async.test.ts×1 flight-owned-transaction.test.ts×1 | Store-wide status gating (RUL-7) |
391+
| §6d | live | `docs/INTERNALS-STORE-STATE.md:364` | reconcile.ts×2 target.ts×2 | — | Diff reachability (RUL-11) |
392+
| §7 | live | `docs/INTERNALS-STORE-STATE.md:376` | optimistic.ts×1 projection.ts×1 | — | Projections & optimism layering |
393+
| §7b | live | `docs/INTERNALS-STORE-STATE.md:386` | scheduler.ts×1 affects.ts×1 optimistic.ts×2 projection.ts×1 reconcile.ts×1 store.ts×8 target.ts×4 | optimistic-chained-revert-3672-memo.test.ts×1 optimistic-removed-prop-3883.test.ts×1 | Chained backing (cross-store) — spec |
394+
| §8 | live | `docs/INTERNALS-STORE-STATE.md:457` | — | l2-contract.test.ts×1 reconcile-resend-identity.test.ts×1 | Assumptions / open questions |
395+
| §8b | live | `docs/INTERNALS-STORE-STATE.md:513` | — | — | Suite-mined rules (2026-08-16) — index & rulings needed |
396+
| §9 | live | `docs/INTERNALS-STORE-STATE.md:749` | — | — | Decision log |
397397
| §11 | live | `docs/NODE-SHAPE.md:29` | — | — | Stage 3 opener: the core tax map (2026-08-21) |
398398
| §11b | live | `docs/NODE-SHAPE.md:53` | constants.ts×1 | rules-index.test.ts×1 treeshake.test.ts×1 | Presence bits — hot-path monomorphism |
399399
| §11c | live | `docs/NODE-SHAPE.md:72` | — | — | Stage-3 increment log |

‎packages/signals/src/store/reconcile.ts‎

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
notifyFoldTail,
3232
notifyKeyDiff,
3333
notifyKeyValue,
34+
ownRow,
3435
sameKey,
3536
sameRow,
3637
targetsEqual,
@@ -104,6 +105,27 @@ function applyAdopt(t: StoreTarget, incoming: any, keyFn: KeyFn | null, proj = f
104105
// — key matching from the arrangement the guesses made (R28), so a row
105106
// the guess added keeps its proxy when the server returns it.
106107
const prevView = fam?.opt === true ? optHooks!.view(t, prev) : prev;
108+
// Descend into a changed child pair — only where something is proxied
109+
// below (§6d), never into a raw-marked leaf, never across array/object or
110+
// a key mismatch (that is a replacement, handled by the parent's slot),
111+
// never into a raw of both frames (it moved: its own row, #3712).
112+
const descend = (pv: any, nv: any): void => {
113+
if (pv === null || typeof pv !== "object" || nv === null || typeof nv !== "object") return;
114+
const ct = lookupTarget(pv, fam);
115+
if (ct === undefined) return; // nothing proxied below this pair
116+
if (!isWrappable(nv)) return;
117+
if (rawValuesUsed && isRawValue(nv)) return;
118+
nv = unwrapValue(nv);
119+
if (Array.isArray(pv) !== Array.isArray(nv)) return;
120+
if (keyFn) {
121+
const pk = keyFn(pv);
122+
const nk = keyFn(nv);
123+
if (pk !== undefined && nk !== undefined && !sameKey(pk, nk)) return;
124+
}
125+
if (!proj && keyFn !== null && !ct.d) return;
126+
if (ownRow(prevView, incoming, pv, nv)) return;
127+
applyAdopt(ct, nv, keyFn, proj);
128+
};
107129
const nextArr = Array.isArray(incoming);
108130
const shallow = t.s === true;
109131
const old = prev;
@@ -133,7 +155,7 @@ function applyAdopt(t: StoreTarget, incoming: any, keyFn: KeyFn | null, proj = f
133155
nv !== null &&
134156
typeof nv === "object"
135157
)
136-
descend(unwrapValue(pvRaw), nv, keyFn, fam, proj);
158+
descend(unwrapValue(pvRaw), nv);
137159
if (
138160
t.dk !== null &&
139161
!dkBumpedA &&
@@ -185,7 +207,7 @@ function applyAdopt(t: StoreTarget, incoming: any, keyFn: KeyFn | null, proj = f
185207
} else {
186208
pv = unwrapValue(prevRows[i]); // keyless item: positional fallback
187209
}
188-
descend(pv, nv, keyFn, fam, proj);
210+
descend(pv, nv);
189211
}
190212
if (nodes !== null) {
191213
const node = nodes[i];
@@ -202,7 +224,7 @@ function applyAdopt(t: StoreTarget, incoming: any, keyFn: KeyFn | null, proj = f
202224
for (let i = 0; i < nlen; i++) {
203225
const nvP = nextRows[i];
204226
if (!shallow && i < dlen && nvP !== null && typeof nvP === "object")
205-
descend(unwrapValue(prevRows[i]), nvP, keyFn, fam, proj);
227+
descend(unwrapValue(prevRows[i]), nvP);
206228
if (
207229
t.dk !== null &&
208230
!dkBumpedP &&
@@ -248,7 +270,7 @@ function applyAdopt(t: StoreTarget, incoming: any, keyFn: KeyFn | null, proj = f
248270
if (nodes !== null && nodes[k] !== undefined) nodesHit++;
249271
continue;
250272
}
251-
if (isObj && !shallow) descend(unwrapValue((prevView as any)[k]), nv, keyFn, fam, proj);
273+
if (isObj && !shallow) descend(unwrapValue((prevView as any)[k]), nv);
252274
if (t.dk !== null && !dkBumped && !(isObj ? targetsEqual(ov, nv) : isEqual(ov, nv))) {
253275
bumpDeep(t);
254276
dkBumped = true;
@@ -267,7 +289,7 @@ function applyAdopt(t: StoreTarget, incoming: any, keyFn: KeyFn | null, proj = f
267289
if (k === $OWNER) continue;
268290
const nv = (incoming as any)[k];
269291
if (!shallow && nv !== null && typeof nv === "object")
270-
descend(unwrapValue((old as any)[k]), nv, keyFn, fam, proj);
292+
descend(unwrapValue((old as any)[k]), nv);
271293
if (nodes !== null) {
272294
const node = nodes[k as any];
273295
if (node !== undefined) {
@@ -286,29 +308,3 @@ function applyAdopt(t: StoreTarget, incoming: any, keyFn: KeyFn | null, proj = f
286308
}
287309

288310
const hasOwnP = Object.prototype.hasOwnProperty;
289-
290-
/** Descend into a changed child pair — only where something is proxied
291-
* below (§6d), never into a raw-marked leaf, never across array/object or a
292-
* key mismatch (that is a replacement, handled by the parent's slot). */
293-
function descend(
294-
pv: any,
295-
nv: any,
296-
keyFn: KeyFn | null,
297-
fam: StoreFamily | null,
298-
proj = false
299-
): void {
300-
if (pv === null || typeof pv !== "object" || nv === null || typeof nv !== "object") return;
301-
const ct = lookupTarget(pv, fam);
302-
if (ct === undefined) return; // nothing proxied below this pair
303-
if (!isWrappable(nv)) return;
304-
if (rawValuesUsed && isRawValue(nv)) return;
305-
nv = unwrapValue(nv);
306-
if (Array.isArray(pv) !== Array.isArray(nv)) return;
307-
if (keyFn) {
308-
const pk = keyFn(pv);
309-
const nk = keyFn(nv);
310-
if (pk !== undefined && nk !== undefined && !sameKey(pk, nk)) return;
311-
}
312-
if (!proj && keyFn !== null && !ct.d) return;
313-
applyAdopt(ct, nv, keyFn, proj);
314-
}

‎packages/signals/src/store/store.ts‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,16 +1592,28 @@ function heldKeyChanged(target: StoreTarget, key: PropertyKey, shape = true): bo
15921592
);
15931593
}
15941594

1595-
/** The values of a held frame, built once per frame: neither the committed
1596-
* frame nor the held staging changes while the hold stands (a draft writes a
1597-
* clone), so the set stays true for every first read of the hold. */
1595+
/** The values of a frame, built once per frame: an adoption's two frames
1596+
* do not change while it pairs their rows (a held one stands until its
1597+
* commit; a draft writes a clone), so the set stays true for every pairing
1598+
* the frame takes part in. */
15981599
const frameRaws = new WeakMap<object, Set<unknown>>();
15991600
function rawsOf(frame: object): Set<unknown> {
16001601
let raws = frameRaws.get(frame);
16011602
if (raws === undefined) frameRaws.set(frame, (raws = new Set(Object.values(frame))));
16021603
return raws;
16031604
}
16041605

1606+
/** A raw present in both frames is its own row (#3712): the same objects
1607+
* swapped or reordered — `[A, B]` to `[B, A]`, `{x: A, y: B}` to
1608+
* `{x: B, y: A}` — moved, they did not change. Pairing `pv`'s target with
1609+
* `nv` would alias the two after the commit (both slots reading one of
1610+
* them); unpaired, each raw keeps its target and the slots change. Checked
1611+
* where rows are paired, eagerly (`descend`) and at a held first read
1612+
* (`adoptChild`). */
1613+
export function ownRow(prev: object, next: object, pv: object, nv: object): boolean {
1614+
return rawsOf(prev).has(nv) || rawsOf(next).has(pv);
1615+
}
1616+
16051617
/** The same row at a slot, as the adoption pairs rows (reconcile.ts): two
16061618
* objects whose keys agree — positionally for an unkeyed family. */
16071619
export function sameRow(pv: any, nv: any, keyFn: ((item: any) => any) | null): boolean {
@@ -1637,10 +1649,7 @@ function adoptChild(target: StoreTarget, key: PropertyKey): boolean {
16371649
Array.isArray(ov) !== Array.isArray(nv) ||
16381650
lookupTarget(ov, target.fam) !== undefined ||
16391651
lookupTarget(nv, target.fam) !== undefined ||
1640-
// A raw in both frames (the same objects swapped or reordered) is its
1641-
// own row: pairing it with another would alias the two after the commit.
1642-
rawsOf(old).has(nv) ||
1643-
rawsOf(k._pendingValue as object).has(ov)
1652+
ownRow(old, k._pendingValue as object, ov, nv)
16441653
)
16451654
return false;
16461655
// A raw-marked value wraps to itself, a proxy to its own target: neither

‎packages/signals/tests/adoption-lazy-child-pairing-3712.test.ts‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,77 @@ describe("#3712 edges: the same raws swapped under a hold stay distinct rows", (
364364
dispose();
365365
});
366366
});
367+
368+
describe("#3712 edges: the same raws swapped with both rows already proxied (the eager pairing)", () => {
369+
for (const held of [false, true]) {
370+
it(`a record swap, rows read before the write (held: ${held})`, async () => {
371+
const A = { name: "a" };
372+
const B = { name: "b" };
373+
const [server, setServer] = createSignal<Record<string, { name: string }>>({ x: A, y: B });
374+
let store!: Record<string, { name: string }>;
375+
let dispose!: () => void;
376+
createRoot(d => {
377+
dispose = d;
378+
[store] = createStore(() => server(), {});
379+
createRenderEffect(
380+
createMemo(() => store.x.name + store.y.name),
381+
() => {}
382+
);
383+
});
384+
flush();
385+
expect([store.x.name, store.y.name]).toEqual(["a", "b"]);
386+
if (held) {
387+
const gate = deferred();
388+
const p = action(function* () {
389+
setServer({ x: B, y: A });
390+
yield gate.promise;
391+
})();
392+
flush();
393+
expect([store.x.name, store.y.name]).toEqual(["a", "b"]);
394+
gate.resolve();
395+
await p;
396+
flush();
397+
} else {
398+
setServer({ x: B, y: A });
399+
flush();
400+
}
401+
expect([store.x.name, store.y.name]).toEqual(["b", "a"]);
402+
expect(store.x).not.toBe(store.y);
403+
dispose();
404+
});
405+
406+
it(`an unkeyed array reorder, rows read before the write (held: ${held})`, async () => {
407+
const A = { id: "a" };
408+
const B = { id: "b" };
409+
const [server, setServer] = createSignal([A, B]);
410+
let store!: { id: string }[];
411+
let dispose!: () => void;
412+
createRoot(d => {
413+
dispose = d;
414+
[store] = createStore(() => server(), []);
415+
createRenderEffect(
416+
createMemo(() => store[0].id + store[1].id),
417+
() => {}
418+
);
419+
});
420+
flush();
421+
if (held) {
422+
const gate = deferred();
423+
const p = action(function* () {
424+
setServer([B, A]);
425+
yield gate.promise;
426+
})();
427+
flush();
428+
gate.resolve();
429+
await p;
430+
flush();
431+
} else {
432+
setServer([B, A]);
433+
flush();
434+
}
435+
expect([store[0].id, store[1].id]).toEqual(["b", "a"]);
436+
expect(store[0]).not.toBe(store[1]);
437+
dispose();
438+
});
439+
}
440+
});

0 commit comments

Comments
 (0)