Generated HTTP client proxy drops fractional seconds in DateTimeOffset query parameters
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Bit.SourceGenerators 10.7.0 emits an HTTP client proxy that drops fractional seconds when a nullable DateTimeOffset is expanded into a query parameter. A UTC cursor of 2026-11-30T15:50:41.1234567+00:00 becomes 11/30/2026 15:50:41 +00:00 in the decoded query. The server binds a valid timestamp that is 1,234,567 ticks earlier than the original.
Expected Behavior
The query parameter should round-trip the timestamp, including its fractional seconds and UTC offset. Invariant O formatting is one way to preserve both.
Steps To Reproduce
Add this controller contract to a Bit Boilerplate shared project and resolve it through the generated typed HTTP client registration.
[Route("api/v1/[controller]/[action]/")]
public interface ICursorController : IAppController
{
[HttpGet("{?beforeAt}")]
Task Get(DateTimeOffset? beforeAt, CancellationToken cancellationToken);
}
Call Get with the cursor below and capture the outgoing request with a recording HttpMessageHandler. Decode the beforeAt value and parse it back to DateTimeOffset. Compare the result to the original with EqualsExact.
var cursor = new DateTimeOffset(2026, 11, 30, 15, 50, 41, TimeSpan.Zero)
.AddTicks(1_234_567);
await controller.Get(cursor, CancellationToken.None);
The default formatting and round-trip formatting can also be compared directly.
var actual = ((IFormattable)cursor).ToString(null, CultureInfo.InvariantCulture);
var expected = cursor.ToString("O", CultureInfo.InvariantCulture);
Exceptions (if any)
No exception. The request succeeds with the wrong timestamp.
.NET Version
11.0.100
Anything else?
- Observed with
Bit.SourceGenerators10.7.0on Windows in a real HTTP integration test against a disposable SQL Server database. - In the test, 52 activity records shared one timestamp and were paginated with a timestamp plus a tie-breaker. The first page returned 25 records. The second returned 0 instead of 25 because the cursor came back truncated to the second, before all records at the original timestamp.
- With a
string?query parameter carrying the explicitly formatted ISO 8601 UTC timestamp, the same test passed with page sizes25 / 25 / 2and all 52 distinct records. - The generated
FormatValue<T>takes theIFormattable.ToString(null, InvariantCulture)path for this value. Source for the tested package.
- 主要言語
- C#
- スター
- 1.4k
- フォーク
- 264
- 平均マージ
- 5時間 45分
- マージ済み PR(30日)
- 494
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bitfoundation/bitplatform のほかの issue
-
Project dependencies are outdated対応中かも @yasmoradi が今日担当しました。 オープンdependencies
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
bitfoundation/bitplatform#15562 ·
メンテナーはふだん 1 日以内に返信
-
EveryListedPageBecomesInteractiveWithoutAnError sometimes fails on WebKit when it leaves the PDF viewer対応中かも @msynk が今日担当しました。 オープン
bitfoundation/bitplatform#15565 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
BitReducedMotionBrowserTests measure an image fade that has already ended対応中かも @msynk が今日担当しました。 オープン
bitfoundation/bitplatform#15564 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
BitDataGridオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
bitfoundation/bitplatform#15548 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
Add the Bit.BbScanner.BlazorUI package with BlazorUI scanner controls対応中かも @msynk が 1 日前に担当しました。 オープンarea / bbscanner area / BlazorUI
bitfoundation/bitplatform#15547 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
bitfoundation/bitplatform の issue をすべて見る
似ている issue
-
:watch: Not Triaged dotnet-target-version
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
dotnet/docs-desktop#2313 ·
メンテナーはふだん 4 日以内に返信
-
dotnet-target-version
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
-
:watch: Not Triaged dotnet-target-version
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
IntelliTect/Coalesce#794 · コメント 1 件 ·
-
bug priority:low severity:S3
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
squid-farm/talewright#909 ·
メンテナーはふだん 1 日以内に返信