Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause: GET /reports/:id in app/api.mjs called report.timezone.trim() unconditionally. Legacy report records (e.g. report-legacy) have timezone: null, so this threw "TypeError: Cannot read properties of null (reading 'trim')" and produced a 500, matching the captured Sentry event and the failing replay of report-legacy.
Fix: default the timezone to "UTC" before trimming: (report.timezone ?? "UTC").trim(). This is the smallest change that keeps existing healthy-timezone behavior (e.g. report-current / Europe/London) unaffected while making legacy null-timezone reports resolve successfully with a UTC-formatted timestamp.
Regression test: app/test/api.regression.test.mjs derives its state directly from the captured incident snapshot (report-legacy with timezone: null, report-current with Europe/London). It asserts the legacy report now returns 200 with timezone "UTC" and the correct generatedAt, and that the healthy report's response is unchanged. This test fails with the original TypeError before the fix and passes after it.
Sentry incident: event. This is the deliberately faulty on-call example app.
Tested against commit
c0051fb2cd810c65e2c2f12a43b85912623d7c35. The same regression command failed before the fix and passed afterward: