[2.0.4] Rows never render when a memo derived from latest(asyncMemo) feeds a second async memo (regression since @solidjs/signals rc.22)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 54/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
Hướng nghiên cứu
Start by reading the failing Vitest reproduction described in the issue and trace how the chained async memos, latest, and the two Show branches update. Compare the behavior with signals rc.21 and inspect the regression introduced in rc.22. Done means the rows render as “Milk” on 2.0.4 behavior, with the reported reproduction passing.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
After two chained async memos resolve, a plain derived function that reads latest(lists) together with a memo derived from latest(lists) keeps its first result. The around the list never switches, so the rows never render: the container stays empty instead of showing "Milk". Effects on each input alone do update.
It works on 2.0.0-rc.21 and fails on every release from 2.0.0-rc.22 to 2.0.4. Bisecting by @solidjs/signals alone (with @solidjs/web rc.21) points to signals rc.22.
It looks related to #5108 (also a memo built on latest(list) with nested , also since rc.22, traced to #4865) and to #5073 (fixed in 2.0.4; its repro passes for us). This shape is client-only: no SSR, no hydration, no onSettled. It still fails on 2.0.4.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Open the repro and run
npm install. - Run
npm test(vitest, happy-dom). The test fails:expected '' to be 'Milk'. - Pin
@solidjs/signalsto2.0.0-rc.21with npmoverrides(andsolid-js/@solidjs/webto2.0.0-rc.21), then runnpm installandnpm testagain. The test passes.
The component under test:
import { createMemo, latest, For, Show } from "solid-js";
const wait = <T,>(v: T, ms = 5) => new Promise<T>((r) => setTimeout(() => r(v), ms));
function Page() {
const lists = createMemo(() => wait(["l1"]), { loadingValue: undefined });
const active = createMemo(() => latest(lists)?.[0] ?? null);
const items = createMemo(
() => (active() ? wait({ key: active(), rows: ["Milk"] }) : undefined),
{ loadingValue: undefined },
);
const rows = () => {
const r = latest(items);
return r && r.key === active() ? r.rows : undefined;
};
const loading = () => !latest(lists) || (active() !== null && !rows());
return (
<>
<Show when={loading()}>loading</Show>
<Show when={!loading()}>
<div>
<For each={rows() ?? []}>{(row) => <i>{row()}</i>}</For>
</div>
</Show>
</>
);
}
All three parts are needed for the failure: the active() !== null read in loading, the loading <Show>, and the <For> inside the other branch. Either of these changes makes it pass:
activereadslists()instead oflatest(lists);loadingreadslatest(active)instead ofactive().
Expected behavior
As a user, I expected the rows ("Milk") to render once both memos resolved, as on 2.0.0-rc.21, but I am seeing an empty container: the derived loading value never re-runs after the second memo resolves.
Screenshots or Videos
None. The test output on 2.0.4:
× renders the rows once both memos resolved
AssertionError: expected '' to be 'Milk'
Platform
- OS: Linux (Debian 13)
- Browser: none (vitest 5 with happy-dom 21; first seen in our app's test suite)
- Version: solid-js 2.0.4, @solidjs/web 2.0.4, @solidjs/signals 2.0.4, @solidjs/vite-plugin 3.0.1, @solidjs/testing-library 1.0.0-rc.2. Works with solid-js, @solidjs/web and @solidjs/signals 2.0.0-rc.21.
Additional context
A second symptom in the same app, also since rc.22 (no standalone repro yet): after a source signal changes, effects that read only latest(source) don't re-run until a downstream async fetch for the new value lands, although an untracked latest(source) already returns the new value.
- Ngôn ngữ chính
- TypeScript
- Star
- 37k
- Fork
- 1.2k
- Merge trung bình
- 8 giờ 43 phút
- Pull request đã merge (30 ngày)
- 365
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[2.0.4] Nested `<Errored>`: the outer boundary stays on an error the inner one rethrew, after the next error is one the inner one handlesCó thể đã có người làm @MilindChatrabhuji đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
activepieces/activepieces#17974 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
OHDSI/Data2Evidence#3777 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AOSSIE-Org/PictoPy#1802 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Termix-SSH/Plugin-Snippets#26 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-reported bug from-app needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nightly-labs/openbot#20504 ·
Maintainer thường phản hồi trong vòng 1 ngày