[Feature]: Make Avg, StdDev, Maximum and Minimum refresh-aware, consistent with Sum

未关闭
#1,214 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@dwcullop 已经在做这个了。

开始于 2026年10月28日。

  • #1219 来自 @dwcullop —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
csharp
领域
backend

调研方向

Read the implementation of Sum and the changes in linked pull request #1219, then trace Avg, StdDev, Maximum, Minimum, Count, IsEmpty and IsNotEmpty through the ForAggregation pipeline. Compare their refresh behavior and decide which operators need stateful projections, immutable variants, or documentation; done means the aggregates behave consistently with the agreed 10.0 model and the release notes describe the behavior and memory impact.

由索引模型根据 Issue 内容生成。

描述

breaking change enhancement
Describe the functionality desired 🐞

The changeset aggregates ignore Refresh. They go through the internal ForAggregation() pipeline, which drops refresh changes, so when an item is mutated in place and refreshed, the aggregate keeps the stale value.

#1167 makes Sum refresh-aware (and adds SumImmutable for the stateless behaviour). Once it merges, Sum will be the only aggregate that honours Refresh, which is inconsistent with Filter, Sort and Group, and with each other: Sum and Avg over the same pipeline would disagree after a refresh.

The remaining aggregates should follow the same model for 10.0.

The steps the functionality will provide
  1. Avg (AvgEx): re-evaluate the selector on Refresh, using stored per-item projections like Sum.
  2. StdDev (StdDevEx): same.
  3. Maximum / Minimum (MaxEx): same; a refresh can move the extreme value, so the current max/min must be recomputed when the refreshed item held it.
  4. Count / IsEmpty / IsNotEmpty (CountEx): no selector, so Refresh cannot change the result. Confirm and document; no behaviour change expected.
  5. Decide per operator whether to add an *Immutable stateless variant, matching SumImmutable.
  6. Share one internal stateful helper rather than duplicating the cache and list bookkeeping per operator.
Considerations

Follow-up to #1167. This is a behavioural change (refresh now alters emitted values, and per-subscription memory becomes O(n)), so it should land in 10.0 alongside the Sum change and be called out in the release notes.

主要语言
C#
星标
1.9k
派生
194
平均合并
12 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

reactivemarbles/DynamicData 的其他 Issue

查看 reactivemarbles/DynamicData 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。