TickerFunctionProvider's registry is publicly writable

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

维护者通常 1 天内回复

@harryhawwy69 已经在做这个了。

开始于 2026年11月24日。

  • #86 来自 @harryhawwy69 —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp

调研方向

Start at src/TickerNet.Utilities/TickerFunctionProvider.cs around lines 35-37 to see how the static registry fields are declared and mutated. Then find every writer of those fields, including the update path in TickerNet.Hub for remote functions, and route it through an internal method while the public surface becomes IReadOnlyDictionary or private set. Add a test that mutates the registry from outside and fails against the current fields, check the ADR and release-notes conventions before writing them, and note that PR #86 already touches this area, so coordinate rather than duplicate.

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

描述

.NET bug

What happens

TickerFunctionProvider (src/TickerNet.Utilities/TickerFunctionProvider.cs, around lines 35-37) exposes its function registry as public, writable static fields. Any code can replace them after startup, which breaks scheduling in ways that are hard to trace.

Fix idea

Make them read-only properties (private set, or IReadOnlyDictionary). This changes public API, so it needs an ADR and a note in the release notes; check TickerNet.Hub, which updates the registry for remote functions, still works through an internal method.


Found while checking which problems that TickerQ fixed after the fork still exist in TickerNet. Fix it from this description and TickerNet's own code only: never read or copy code from TickerQ 10.5.0 or later (see CONTRIBUTING.md). Please add a test that fails before the fix.

主要语言
C#
星标
0
派生
2
平均合并
1 小时 8 分钟
30 天内合并 PR
24

环境准备

从这里开始

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

TickerNet/TickerNet 的其他 Issue

查看 TickerNet/TickerNet 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

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