Skip to content

A reader created in the flush that clears an upstream error shows an empty hole instead of the async memo's result #4378

Closed

Description

@ryansolid

Found by the async app generator's E8 pair, the carve audit's birth-seat pair: a reader born before a write vs one born in the flush that applies it (#4371). Reproduces on next 5f60713.

const [s, setS] = createSignal(3);
const m0 = createMemo(() => {
  const v = 1 + latest(s);
  if (v % 4 === 0) throw new Error("m0"); // throws at s = 3
  return v;
});
const m1 = createMemo(() => fetchM1(1 + m0())); // at s = 2 asks for 4, which rejects
const [epoch, setEpoch] = createSignal(1);

render(() => (
  <Errored fallback={e => "[ERR]"}>
    <Loading fallback="[LOAD]">
      <Show when={epoch()} keyed>
        <span>{m1()}</span>
      </Show>
    </Loading>
  </Errored>
), el);
// [ERR]
setS(2);
setEpoch(2); // same batch: the <span> reader is recreated in the flush that applies the write
// settle every request
  • Without setEpoch(2), the existing reader ends at [ERR] (m1 rejects). This matches a fresh render.
  • With setEpoch(2), the screen ends at <span></span>, with nothing in flight. The new reader of m1 neither shows its error nor waits for it.

Activity

  1. ryansolid commented on Oct 28, 2026

    @ryansolid
    MemberAuthor

    Fixed on next by #4390 (1b32ff2); 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