Skip to content

[2.0 / next] latest(m2) reveals a lane's answer while m1 of the same lane is still in flight (F-6) #4408

Closed

Description

@ryansolid

Summary

Two latest() async readers sit under one async memo. s is written, and t about 12 ms later while the s flush is parked. A render effect showing latest(m2) (where m2 = m0b() + 1) shows c1101 while m1:1122 of the same lane is still in flight. Under F-6 (amended 2026-10-28: the parent waits for the lane's flights) and D-26, the lane's readers show its answer together, so c1101 must not show before v1122.

Reproduction

const [s, setS] = createSignal(1);
const [t, setT] = createSignal(0);
const ask = (n, v) => (log(`${n}:${v}`), sleep(10).then(() => v));
const m0 = createMemo(() => ask("m0", 1 + 10 * latest(s) + s()));
const m0b = createMemo(() => ask("m0b", 100 * (10 * latest(t) + t())));
const m1 = createMemo(() => ask("m1", m0() + m0b()));
const m2 = createMemo(() => m0b() + 1);
createLoadingBoundary(() => {
  createRenderEffect(() => `v${m1()}`, show);
  createRenderEffect(() => `c${latest(m2)}`, show);
  return null;
}, () => "L");
// settle, then:
setS(2); flush(); await sleep(12); flush();
setT(1); flush();
// settle

Pinned as it.fails in packages/signals/tests/latest-two-readers-one-ask-4393.test.ts ("m1's lane pass is not re-derived over a staging that lands with it (beside)") with #4393.

Observed

c1101 shows while m1:1122 is in flight, before v1122.

Expected

v1122 shows no later than c1101, and after c1101 the only v value shown is v1123. Each question is asked once.

Notes

Activity

  1. ryansolid commented on Oct 31, 2026

    @ryansolid
    MemberAuthor

    Fixed on next by #4510 (2ba10bd); it ships in the next RC.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions