2.0.0-rc.14: until() through a synchronous memo misses optimistic confirmation
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
- 3-5 ngày
- Mức phù hợp với người mới
- 35/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ệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by reproducing with the playground component in the issue, then swap the predicate between doubled() and count() to confirm the memo is the difference. The payload names no source files, so you will need to find where until() subscribes and how a synchronous createMemo propagates optimistic values on confirmation. Done when yield until(() => doubled() === 2) completes after setSource(1), matching the direct-read control.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
On 2.0.0-rc.14, an action waiting with until() through a synchronous memo remains pending when the actual source confirms its optimistic prediction. Reading the optimistic accessor directly in the predicate completes the same action.
The predicate subscribes before confirmation arrives. The prediction alone correctly does not satisfy the wait, but confirming it does not resolve the wait through the memo either.
Your Example Website or App
https://s.olid.uk/?id=d1d1a3ee-70c8-4afe-966d-258809cb4f06
The playground uses published 2.0.0-rc.14. Here is the full component, including the actual source update in the Confirm button:
import { action, createMemo, createOptimistic, createSignal, until } from "solid-js";
import { render } from "solid-js/web";
function App() {
const [source, setSource] = createSignal(0);
const [count, guess] = createOptimistic(() => source());
const doubled = createMemo(() => count() * 2);
const [completed, setCompleted] = createSignal(false);
const save = action(function* () {
guess(1);
yield Promise.resolve();
// Direct-read control: yield until(() => count() === 1);
yield until(() => doubled() === 2);
});
return (
<main>
<button onClick={() => save().then(() => setCompleted(true))}>1. Start</button>
<button onClick={() => setSource(1)}>2. Confirm</button>
<p>Displayed count: {count()}</p>
<p>Doubled memo: {doubled()}</p>
<p>Action completed: {String(completed())}</p>
</main>
);
}
render(() => <App />, document.getElementById("app")!);
Steps to Reproduce the Bug or Issue
- Open the playground and click 1. Start.
- The displayed count becomes
1and the doubled memo becomes2. Action completion remainsfalse, as expected while the prediction is unconfirmed. - Click 2. Confirm to set the actual source to
1. - Action completion still remains
false. - Change the wait to
yield until(() => count() === 1), rebuild, and repeat. Action completion becomestrueafter confirmation.
Both the failing memo case and the successful direct-read control were verified in the browser.
Expected behavior
The optimistic prediction alone should not satisfy until(). Once the actual source confirms the prediction, the predicate through the synchronous memo should resolve and the action should complete, just as the direct-read predicate does.
Platform
- OS: Linux (WSL)
- Browser: Chrome for Testing 153.0.8010.12, tested with Playwright
- Solid:
2.0.0-rc.14
- Ngôn ngữ chính
- TypeScript
- Star
- 36.1k
- Fork
- 1.1k
- Merge trung bình
- 11 giờ 25 phút
- Pull request đã merge (30 ngày)
- 345
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ó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Select loses its bound value when options load asynchronouslyCó thể đã có người làm @MokiMeow đã nhận hôm nay. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 45/100
solidjs/solid#3928 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 24/100
solidjs/solid#3923 · 1 bình luận ·
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 8/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ự
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked filesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
maniator/verticopolis#880 ·
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 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
siyuan-note/siyuan#20353 ·
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 72/100
black-forest-labs/skills#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Albert-Weasker/niubigeo#168 ·
Maintainer thường phản hồi trong vòng 1 ngày