Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix time zone bug in "Edit report" form #3581

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

ericpgreen2
Copy link
Contributor

Before this PR, editing a scheduled report and clicking "Save" sometimes led the user to a 404 page. This happened because:

  1. We instantiated the "Edit report" form with the time zone abbreviation, not with the underlying IANA time zone.
  2. When the form was submitted with this time zone abbreviation, it resulted in an "invalid time zone" error in the virtual report file.
  3. The presence of this error caused the report resource to be torn down.
  4. Because the report resource no longer existed, a 404 page resulted.

This PR fixes this.

@ericpgreen2 ericpgreen2 added the Type:Bug Something isn't working label Nov 29, 2023
@ericpgreen2 ericpgreen2 self-assigned this Nov 29, 2023
@ericpgreen2 ericpgreen2 mentioned this pull request Nov 29, 2023
16 tasks
reportSpec.refreshSchedule.timeZone
)
: "",
timeZone: reportSpec.refreshSchedule?.timeZone ?? "",
Copy link
Member

Choose a reason for hiding this comment

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

Why not default to Etc/UTC here instead of empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good callout. All UI-created reports (which are the only ones editable via this dialog) will have a timeZone. Just updated to:

timeZone: reportSpec.refreshSchedule?.timeZone as string, // all UI-created reports have a timeZone

@ericpgreen2 ericpgreen2 merged commit a94f524 into main Nov 30, 2023
2 checks passed
@ericpgreen2 ericpgreen2 deleted the fix-edit-report-time-zone-bug branch November 30, 2023 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants