Clients return null, cannot be cancelled and drop Retry-After; the SDK reads the system clock

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp, typescript

调研方向

Start with the listed locations: FluentCmsClient.cs, clients/typescript/src/client.ts, SystemOperation.cs, CmsEvent.cs, docs/analyzers.md, and Descriptors.cs; inspect the related client, SDK, and analyzer tests and the changes in #3273. The acceptance checklist defines done across six areas, from cancellation and Retry-After handling to API baselines and diagnostic documentation. This spans multiple packages and client implementations, so it requires substantial project context.

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

描述

area:sdk type:bug

Problem

  1. The .NET client can return null for a non-nullable result. FluentCmsClient.cs:120-123 returns default for an empty body or a 204, and :127 returns null for a literal null body; callers suppress it with ! (:32,39,47,55,62,71,85,92). A proxy answering 200 with an empty body gives a NullReferenceException later.
  2. The TypeScript client has no cancellation or timeout. clients/typescript/src/client.ts:100-105 builds RequestInit without a signal, and no method takes one.
  3. Both clients discard Retry-After on a 429. FluentCmsClient.cs:114 and client.ts:107-108 pass only the status and body to the error.
  4. The SDK reads the system clock directly. src/FluentCMS.Sdk/Content/SystemOperation.cs:42 and src/FluentCMS.Sdk/Events/CmsEvent.cs:9 use DateTimeOffset.UtcNow instead of the injected TimeProvider.
  5. FluentCMS.Client has no tracked public API, unlike Sdk, Plugins.Abstractions and the two admin packages.
  6. FCMS0100–FCMS0104 are undocumented. docs/analyzers.md:5 only reserves the range, and src/FluentCMS.Generators/Descriptors.cs sets no helpLinkUri, unlike src/FluentCMS.Analyzers/Rules.cs:22.

Proposal

  • Throw FluentCmsProblemException when a result is expected and the body is empty or null.
  • Accept a signal per call and a timeoutMs option in the TypeScript client.
  • Expose RetryAfter on the problem type of both clients.
  • Take a TimeProvider in SystemOperation; let the bus stamp events.
  • Add the public API analyzer and baseline to FluentCMS.Client.
  • Document the five diagnostics and link them.

Done together with #3273, which changes the same two clients.

Acceptance

  • An empty or null body where a result is expected throws a problem exception
  • A TypeScript call can be aborted, and times out at timeoutMs
  • A 429 exposes the Retry-After of the server in both clients
  • No DateTimeOffset.UtcNow remains in FluentCMS.Sdk
  • A change to the public API of FluentCMS.Client fails the build until the baseline is updated
  • Each of FCMS0100–FCMS0104 has a section in docs/analyzers.md and a help link

Found in the code review of 17 Nov 2026.

主要语言
C#
星标
569
派生
107
平均合并
2 小时 49 分钟
30 天内合并 PR
397

环境准备

从这里开始

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

fluentcms/FluentCMS 的其他 Issue

查看 fluentcms/FluentCMS 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

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