[Bug]: RemoveKey loses entry identity for equal values and produces invalid list indexes

Đang mở
#1,182 1 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

@dwcullop đang làm issue này rồi.

Từ ngày 21/9/2026.

  • #1192 của @dwcullop — đang mở

Đá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
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

The payload names regression test cases but not their file paths. Start by locating those tests and the index-free RemoveKey().Filter() implementation, then reproduce the failing equal-value and shared-reference cases. Done means each logical key updates or removes only its own entry, indexed positions remain valid, and the listed regression checks pass; PR #1192 is already open.

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

Mô tả

bug

Please note we can't commit to any timeline.

Describe the bug 🐞

Index-free list changes cannot distinguish different cache keys whose values compare equal, or keys sharing the same object. The new filter fallback selects the first equality match. Refreshing another key can retain an excluded item or update the wrong position. Unindexed update/remove paths also fail list validation/filtering.

Step to reproduce

Create two distinct cache keys with comparer-equal values. Include only the second value in source.Connect().RemoveKey().Filter(predicate), exclude that value, and refresh its key. Also exercise shared references, custom-equal structs, updates, removals and indexed moves.

Regression tests/checks:

EqualValuesAreRefreshed_FilterRemovesTheChangedKey; SharedReferenceIsRefreshed_FilterTracksEachKeySeparately; EqualValueTypesAreRefreshed_FilterRemovesTheChangedKey; EqualValuesAreUpdated_OnlyTheChangedKeyIsReplaced; EqualValuesAreRemoved_OnlyTheChangedKeyIsRemoved; IndexedMovesAndUpdates_KeepEqualValuesAtTheirKeyedPositions
Reproduction repository

https://github.com/reactivemarbles/DynamicData/tree/85ee49cfd54d8782c36ed137886d318e942345c4

Regression tests and fixes:
https://github.com/reactivemarbles/DynamicData/tree/u/dacullop/main/pr-1165-review

Expected behavior

Discarding keys must retain enough positional identity for each logical entry to be changed independently. No excluded entry, unrelated replacement, invalid index, or error should remain.

Screenshots 🖼️

N/A.

IDE

N/A; command-line reproduction.

Operating system

Windows.

Version

.NET SDK 10.0.401; net9.0 test target.

Device

N/A.

DynamicData Version

Main 10.0-preview at 85ee49cfd54d8782c36ed137886d318e942345c4. The related 9.5 candidate is PR #1165 at 3d76872ead1351e423eefb16b5c15e1d1c6c0aa2.

Additional information ℹ️

Repository tests retain excluded entries, select the wrong key, reject negative replacement indexes, or report ArgumentOutOfRangeException on updates/removals. Related to #1119, but the equality fallback additionally turns an exception into silent wrong results.

Ngôn ngữ chính
C#
Star
1.9k
Fork
194
Merge trung bình
12 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 reactivemarbles/DynamicData

Tất cả issue của reactivemarbles/DynamicData

Issue tương tự

Thêm issue về C#

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.