Skip to content

Parse GitHub timestamps with the invariant culture in GitHubClient #723

Closed

Description

@JSdotNet

GitHubClient parses ISO-8601 timestamps with the current culture and no RoundtripKind, unlike its three sibling clients. On a machine whose culture is not invariant, issue and pull-request timestamps can parse differently or fail, and the value silently becomes null. Found in the 2026-09-27 repository review.

Context

src/Infrastructure/Backlog.Infrastructure.GitHub/GitHubClient.cs line 400:

&& DateTimeOffset.TryParse(value.GetString(), out var parsed)

The three other copies of the same helper pass CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind:

  • src/Infrastructure/Backlog.Infrastructure.GitHub/CopilotUsageClient.cs line 259
  • src/Infrastructure/Backlog.Infrastructure.GitHub/GitHubActivityClient.cs line 1055
  • src/Infrastructure/Backlog.Infrastructure.Claude/ClaudeUsageClient.cs line 393

Fix the parse in GitHubClient.cs to match. While there, collapse the four Timestamp(JsonElement, string) helpers (and the three identical Rfc3339 helpers at GitHubActivityBaselineClient.cs line 166, GitHubActivityClient.cs line 1037 and ClaudeUsageClient.cs line 366) into one internal helper so the next copy cannot drift. Add a test in tests/Backlog.Infrastructure.GitHub.UnitTests that runs the parse under a culture such as de-DE and asserts the same instant comes back.

Route through delivery:flow-code per CLAUDE.md.

Activity

  1. added
    bugSomething isn't working
    triagedClassified by the issue sweep
    in-progressA worker session is actively working this issue
    on Sep 27, 2026
  2. self-assigned this
    on Sep 28, 2026
  3. JSdotNet commented on Sep 28, 2026

    @JSdotNet
    OwnerAuthor

    The issue sweep opened a draft pull request for this issue: #794. Read its What could not be proved section before marking it ready.

  4. removed
    in-progressA worker session is actively working this issue
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriagedClassified by the issue sweep

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions