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

Abierto
#1,182 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@dwcullop ya está trabajando en esto.

Desde el 21/9/2026.

  • #1192 de @dwcullop — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C#
Estrellas
1.9k
Forks
194
Merge medio
12 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de reactivemarbles/DynamicData

Todos los issues de reactivemarbles/DynamicData

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.