compareDeep reports unequal Sets as equal
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- data
Hướng nghiên cứu
Start in packages/store/src/compare.ts at the deep Set branch and review both one-to-many matching and circular-reference guard behavior. Run the two provided compareDeep reproductions as regression tests, then verify both return false. Note that PR #400 is already open, so this work is currently under way.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
compareDeep can report two different Sets as equal. There are two causes, both in the deep Set branch of packages/store/src/compare.ts:
- Every element of the first Set is checked with
[...objB].some(...), so several elements of A can match the same element of B. - The circular-reference guard adds each
(a, b)pair toseenand never removes it. When a.some()attempt fails, the pair stays recorded, so a later comparison of that same pair returnstruestraight away.
Steps to Reproduce the Bug or Issue
import { compareDeep } from '@tanstack/store'
// 1. two elements of A both match B's { x: 1 }
compareDeep(new Set([{ x: 1 }, { x: 1 }]), new Set([{ x: 1 }, { x: 2 }])) // true
// 2. a failed Set-matching attempt (p vs q2) is later treated as equal
const p = { x: 1 }, q = { x: 2 }
const p2 = { x: 1 }, q2 = { x: 2 }
compareDeep([new Set([p, q]), p], [new Set([q2, p2]), q2]) // true, even though p !== q2 deeply
Expected behavior
Both calls return false.
Platform
@tanstack/store main (53f30be), Node 26
Additional context
I have a fix with tests ready and will open a PR.
- Ngôn ngữ chính
- TypeScript
- Star
- 913
- Fork
- 121
- Merge trung bình
- 19 giờ 51 phút
- Pull request đã merge (30 ngày)
- 2
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 TanStack/store
-
svelte-store: extensionless re-exports in src/index.svelte.ts break Node ESM and nodenext typesCó thể đã có người làm @Mittalnew đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
TanStack/store#412 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`useSelector` triggers `state_proxy_equality_mismatch` on every store update in svelte-storeCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TanStack/store#322 · 3 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Missing atom docsCó thể đã có người làm @looooown2006 đã nhận 196 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Reading a computed atom without subscribing can prevent garbage collectionCó thể đã có người làm @Sheraff đã nhận 52 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
TanStack/store#299 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/store
Issue tương tự
-
inference/go type/feature
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#65148 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
truapi-release
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
paritytech/product-sdk#529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Mansudae TVĐang mởapproved check:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/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 77/100
devlikeapro/waha#2369 ·
Maintainer thường phản hồi trong vòng 5 ngày