Optimistic writes disappear on rows retained from a derived store's draft
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 70/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 examining the store implementation, focusing on how writable derived stores retain rows from drafts and how createOptimisticStore applies updates. Look at the regression tests for #3767 to understand the expected behavior for ordinary writes, then add a similar test case for optimistic writes. The fix should ensure optimistic updates correctly modify retained rows, possibly by copying them as described in the workaround.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
A writable derived store retains a local row across a source refresh:
const [local, setLocal] = createStore<Row[]>(
draft => [...source(), ...draft.filter(row => row.id === "local")],
[],
);
const [view, setView] = createOptimisticStore(local);
After the refresh, an action optimistically sets the retained row's value to 1 and waits two seconds. The optimistic view keeps showing 0 throughout the action.
There are no concurrent actions or pending source updates; the setup updates finish before the action starts.
Your Example Website or App
https://s.olid.uk/id/zG2yQHbUQPa-SyUMiPm_pg
Steps to Reproduce the Bug or Issue
- Open the playground.
- Click Run once. The button creates a local row, refreshes the source, then starts the optimistic action, with 100 ms delays between setup updates.
- Observe that Local value stays at
0during the two-second action.
Expected behavior
The optimistic view should show Local value: 1 while the action is pending, then revert to 0 when the action finishes without persisting the change.
Screenshots or Videos
No response
Platform
- OS: Linux
- Browser: Chromium 153.0.8010.12
- Solid: published preview
mizulu/solid2@5c2174c
Additional context
Returning a copy of the retained row (draft.filter(...).map(row => ({ ...row }))) makes the optimistic update appear and revert as expected. Both variants were tested in the browser.
The retained-draft-row pattern is already covered for ordinary writes by the regression tests for #3767. This report concerns optimistic writes over that store.
The playground has Tailwind disabled.
- Ngôn ngữ chính
- TypeScript
- Star
- 36.1k
- Fork
- 1.1k
- Merge trung bình
- 11 giờ 17 phút
- Pull request đã merge (30 ngày)
- 371
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
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14Có thể đã có người làm @itisrmk đã nhận 5 ngày trước. Đang mở1.x
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/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
solidjs/solid#4182 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ 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
-
`createRoot`'s dispose function keeps `fn` alive, so `<For>`/`<Index>` rows retain removed list itemsCó thể đã có người làm @boombang đã nhận 7 ngày trước. Đang mở1.x
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
signals: a landing reveals a held write its stale reader re-derives onto a new flight (U-5, D-9)Đang mở
Độ 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
Tất cả issue của solidjs/solid
Issue tương tự
-
native
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
prime-radiant-inc/evener#4839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
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 74/100
processone/fluux-messenger#1790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🛣️ Infrastructure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
opencrvs/opencrvs-core#14232 ·
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
kunchenguid/gh-axi#220 ·
Maintainer thường phản hồi trong vòng 1 ngày