Generated HTTP client proxy drops fractional seconds in DateTimeOffset query parameters
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- C#
- Star
- 1.4k
- Fork
- 264
- Merge trung bình
- 5 giờ 45 phút
- Pull request đã merge (30 ngày)
- 494
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bitfoundation/bitplatform
-
Project dependencies are outdatedCó thể đã có người làm @yasmoradi đã nhận hôm nay. Đang mởdependencies
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
bitfoundation/bitplatform#15562 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
EveryListedPageBecomesInteractiveWithoutAnError sometimes fails on WebKit when it leaves the PDF viewerCó thể đã có người làm @msynk đã nhận hôm nay. Đang mở
bitfoundation/bitplatform#15565 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BitReducedMotionBrowserTests measure an image fade that has already endedCó thể đã có người làm @msynk đã nhận hôm nay. Đang mở
bitfoundation/bitplatform#15564 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BitDataGridĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
bitfoundation/bitplatform#15548 · 8 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add the Bit.BbScanner.BlazorUI package with BlazorUI scanner controlsCó thể đã có người làm @msynk đã nhận 1 ngày trước. Đang mởarea / bbscanner area / BlazorUI
bitfoundation/bitplatform#15547 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bitfoundation/bitplatform
Issue tương tự
-
State: Needs Discussion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
getsentry/sentry-dotnet#6071 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
:watch: Not Triaged dotnet-target-version
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
dotnet/docs-desktop#2313 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
dotnet-target-version
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
-
:watch: Not Triaged dotnet-target-version
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
IntelliTect/Coalesce#794 · 1 bình luận ·