[2.0.0-rc.20] isPending disagrees with an async memo derived from it

Đang mở
#4,677 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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
22/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 payload names no source files, so start by running the linked repro pinned to Solid 2.0.0-rc.20 and confirming the stale pending: true badge appears about one second after clicking "Load item 1". The entry points are isPending(id) and the async memo that reads both id() and isPending(id). Done means the badge and the pending output agree at every step, unless the deferral boundary is explicit. Expect to work through the reactive scheduling core, so ask a maintainer before starting.

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

Mô tả

Describe the bug

An async memo that reads both id() and isPending(id) can publish a badge containing pending: true while a separate binding of isPending(id) displays false.

In the repro, an independent details memo takes 500 ms. The badge captures the ID and pending status synchronously, then returns that presentation after 1000 ms. Item 0 starts with synchronous, already-loaded values.

The visible sequence after setting id to 1 is:

Time       ID   Details   Pending   Async badge
Initially   0   Item 0    false     ID: 0, pending: false
~1000 ms    0   Item 0    false     ID: 0, pending: true
~2000 ms    1   Item 1    false     ID: 1, pending: false

The pending output and its async derivation visibly disagree for about one second.

Your Example Website or App

https://s.olid.uk/id/ZVQj3v1XQf6iq45C1GJAFw

Steps to Reproduce the Bug or Issue
  1. Open the linked repro, pinned to Solid 2.0.0-rc.20.
  2. Click "Load item 1" once.
  3. After about one second, observe Pending: false beside Async badge: ID: 0, pending: true.
  4. After about two seconds, both settle. Reload to repeat.
Expected behavior

The pending output and ordinary derivations of that output should publish consistently. isPending can intentionally differ from its input's ordinary published value, but its async badge should not disagree with the pending output itself without an explicit deferral boundary.

Screenshots or Videos

No response

Platform
  • OS: Debian GNU/Linux 13 (Linux)
  • Browser: Chromium 154.0.8037.57 (automated verification)
  • Solid: 2.0.0-rc.20, development build
Additional context

Verified from the saved repro in a fresh browser context, with no runtime errors. Tailwind is disabled. The example uses ordinary JSX bindings, two memos, real setTimeout delays, and one signal setter. There is no Loading, createDeferred, manual flush, or effect writing a signal.

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

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.