Skip to content

simulate --since compares ISO timestamps as strings, so the cycle window is wrong for non-UTC offsets #4

Description

@Oyinkans0la12

packages/cli/src/contributions.ts filters the cycle window with a lexicographic string compare:

if (options.since !== undefined && pr.mergedAt < options.since) continue;

--since / manifest generatedAt values are validated with Date.parse in resolveSince and then passed through unnormalized, so any format Date.parse accepts is allowed — including explicit offsets. String ordering only agrees with instant ordering when both sides carry the same offset suffix.

Counterexample: --since 2026-09-10T09:00:00+09:00 is the instant 2026-09-10T00:00:00Z. A PR merged at 2026-09-10T08:00:00Z is after that instant and must be counted, but "2026-09-10T08:00:00Z" < "2026-09-10T09:00:00+09:00" is true, so it is silently dropped — a smaller denominator and different payouts for everyone else.

Fix: normalize since to an ISO-8601 UTC string at the resolveSince boundary (and store that), and compare Date.parse(pr.mergedAt) against Date.parse(since). A test with a non-Z offset and a same-Z fractional-seconds timestamp would pin it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions