Skip to content

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

  1. Visit http://localhost:3000/root
  2. Click on a day of the year with a contribution in it and see contributions load correctly
  3. Run
UserPreference::find(1).update!(timezone: 'nonexist')
  1. 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

!74884 (merged)

Edited by David Barr