Skip to content

Bug 2089049 - REST /bug/2048343/history fails with internal error: Can't call method "iso8601" on an undefined value at Bugzilla/API/V1/Util.pm line 362 - #2812

Merged
dklawren merged 5 commits into
mozilla:masterfrom
dklawren:2089049
Nov 7, 2026

Conversation

@dklawren

@dklawren dklawren commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Changes (2 files, not committed):

  1. Bugzilla/API/V1/Util.pm:361: when type('dateTime', …) gets a value that datetime_from() can't parse, it now returns the raw string instead of crashing on undef. Valid dates still come back as ISO 8601 with a Z.
  2. t/api-util-type-datetime.t (new): checks a valid date, an empty date, undef, and the joined value from bug 2048343. 4 of 4 pass.

…n't call method iso8601 on an undefined value at Bugzilla/API/V1/Util.pm line 362
@dklawren
dklawren requested review from Xzzz and cgsheeh and a balanced review from Copilot November 4, 2026 18:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change intended to prevent REST bug-history failures on unparseable date values.

No open issues 🎉

What changed in this PR

Prevents REST bug-history requests from failing when a date value cannot be parsed, such as joined activity values.

Changes:

  • Returns unparseable date values as raw strings instead of calling iso8601() on an undefined value.
  • Preserves UTC ISO 8601 formatting for valid dates and empty-string handling for missing values.
File Description
Bugzilla/​API/​V1/​Util.pm Adds a safe fallback for unparseable dateTime values.

Review effort: Balanced

@Xzzz Xzzz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!
Just one thing: the description mentions a new t/api-util-type-datetime.t, but it isn't in this PR. Is it wanted?

@cgsheeh cgsheeh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description mentions a new t/api-util-type-datetime.t test, but it isn't in the diff. Was it left uncommitted? It would be good to include it, ideally with the joined value from bug 2048343.

Comment thread Bugzilla/API/V1/Util.pm Resolved
Comment thread Bugzilla/API/V1/Util.pm Resolved
@dklawren
dklawren merged commit 417eaf4 into mozilla:master Nov 7, 2026
7 checks passed
@dklawren
dklawren deleted the 2089049 branch November 7, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants