`store.users.push(x)` in a handler compiles with no diagnostic, and the write is lost
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
- 62/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
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start by running analyze on the program in the issue, which reports nothing, and by reading the lowered handler __rt.snapshot(v$store)?.users?.push(2). Find where the checker walks handler bodies and inspect member calls whose receiver is a source path, then check the list of mutating methods against decision 20 in 07. Done when analyze emits a diagnostic that points to the := form for push and the other listed methods, and the existing checker tests still pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Calling a mutating method on a source's value in a handler, such as store.users.push(2), compiles with no diagnostic, and the write never happens. 07 decision 20 says "only := and guess mutate", so this should be a diagnostic that points to the := form, for example store.users := [...store.users, 2].
Program
export default component App() {
source store := { users: [1] }
<main>
<button onClick={() => { store.users.push(2) }}>add</button>
<p>{len(store.users)}</p>
</main>
}
analyze reports no diagnostics. The handler lowers to:
__rt.snapshot(v$store)?.users?.push(2);
That calls push on a read of the store, outside its setter. Solid ignores the write. In development it logs [STORE_WRITE_OUTSIDE_SETTER] Writing store property "1" outside its setter was ignored; that warning is development-only, so a production build drops the write without a word.
Frames
| instant | action | frame |
|---|---|---|
| 0 | mount | add1 |
| 1 | click add |
add1 (the list is unchanged) |
splice behaves the same way, and so presumably do the other mutating methods (pop, shift, unshift, sort, reverse, fill, copyWithin, and Map/Set writes). A program can also reach this through a plain function the handler calls with the source's value, which the checker may not be able to see. The direct call on a source path is the case it can see.
Version: main at e650b85.
- Ngôn ngữ chính
- TypeScript
- Star
- 127
- Fork
- 7
- Merge trung bình
- 15 giờ 42 phút
- Pull request đã merge (30 ngày)
- 63
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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/reactivescript
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
solidjs/reactivescript#96 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Vite front end keeps serving a failed build after the missing/broken imported module is fixedCó thể đã có người làm @cgaaf đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
solidjs/reactivescript#84 ·
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 76/100
solidjs/reactivescript#77 ·
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 78/100
solidjs/reactivescript#74 ·
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 48/100
solidjs/reactivescript#83 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/reactivescript
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
GetStream/stream-chat-react#3467 ·
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
vercel-labs/ui#1139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Có thể đã có người làm @goranai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] IntegerRange.contains counts a non-integer just above max as inside an inclusive rangeĐang mởbot:ai-assisted component:platform-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
midnightntwrk/platform-js#93 ·
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