Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[2.0 / next] A memo reading latest(a) beside b() computes a torn pass on a batched write; if that pass throws, the error sticks

Đang mở
#4,365 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

The reproduction is in packages/web/test/async-gen; begin by reading it and tracing how latest, createMemo, and batched writes interact in Solid’s reactive runtime. Add a regression test for the throwing memo and the torn tuple case, then verify that the memo reaches the fresh value after the batch and effects do not commit a mixed tuple. The issue does not name the runtime implementation file or an existing test command.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Found by the async app generator (packages/web/test/async-gen, branch claude/project-thread-bgafe5), minimized. There is no async anywhere in this case.

const [a, setA] = createSignal(1);
const [b, setB] = createSignal(0);
render(() => {
  const m = createMemo(() => {
    const v = latest(a) + b() + 1;
    if (v % 4 === 3) throw new Error("m:" + v);
    return v;
  });
  return <Errored fallback={e => `[E ${e()?.message}]`}><span title={String(m())} /></Errored>;
}, el);
flush();
setB(3); setA(2); flush();
// m computes latest(a)=2 with b()=0 → 3 → throws, and never re-runs: screen stays [E m:3]

Expected: m = 2 + 3 + 1 = 6, <span title="6">. A fresh render with a=2 and b=3 shows that.

Actual on next (1f558e50): the memo runs one pass with the new latest(a) beside the old b(). When that pass throws, the boundary keeps the error, and nothing re-runs m with b=3.

Without the throw, the torn pass still reaches effects. In a memo returning [latest(s), s()] after set(2), a render effect commits [2,1] before [2,2]. That is a torn tuple from a plain write with no transition held, which "latest tears" (#4284) doesn't seem to cover.

Ngôn ngữ chính
TypeScript
Star
36.2k
Fork
1.1k
Merge trung bình
10 giờ 28 phút
Pull request đã merge (30 ngày)
379

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của solidjs/solid

Tất cả issue của solidjs/solid

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.