FIX: CurrentUser now must be passed to resolveTimezone and user card local time issues (PR #9734)

  • This is to prevent user’s timezones being changed accidentally e.g. by admin looking at a user
  • This problem only occurred via the user card, however the user card was still calling userTimezone even if the setting to display user time in card was disabled

GitHub

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/improved-bookmarks-with-reminders/144542/173

Oh, good catch. It looks like something that would be very easy to miss next time, so what about a console warning if you call resolvedTimezone() without passing in a user?

I did consider raising an error or something like that, but you will see an error in the console if currentUser is not passed because we are checking for currentUser.id. So there will be a “cannot access property id of null” error.