Regression in user calendar activities where user timezone is incorrectly set
Summary
In !72938 (merged), I introduced a feature for shifting the user's contribution calendar based on their timezone preference.
If a user's timezone is set incorrectly, this may result in a HTTP 500 error.
Steps to reproduce
- Visit http://localhost:3000/root
- Click on a day of the year with a contribution in it and see contributions load correctly
- Run
UserPreference::find(1).update!(timezone: 'nonexist')
- Repeat Step 2.
This also occurs if the user's timezone is set to ''
. It does not occur if its nil
.
What is the current bug behavior?
Clicking a contribution day on a calendar where the user's timezone is incorrectly set results in an error.
What is the expected correct behavior?
Clicking a contribution day on a calendar where the user's timezone is incorrectly set reverts to the server timezone.
Relevant logs and/or screenshots
Sentry link: https://sentry.gitlab.net/gitlab/gitlabcom/issues/2974421
As advised by: #335343 (comment 731753732)
Possible fixes
Edited by David Barr