Timezone is preventing students accessing a task

Timezone is preventing students accessing a task

Problem

Users cannot save their timezone.
Users cannot access a task.

Known issue

There is a bug that we haven't figured out yet associated with the account registration and login journey. It appears to only affect new users when setting their timezone or when accessing a task for the first time. It may be something to do with registering via an SSO provider.

Solution

This solution has been 100% effective in resolving the issue for all users to date.
The student must log out of Smart Revise and back in again. They do this by clicking their profile icon in the top right corner and selecting the "LOG OUT" button. Closing the browser or logging out of the operating system account does not fix the problem because the Smart Revise session may still be active.


Sometimes users report they have logged out and the problem persists. On investigation it has been discovered that the user has not initiated the Smart Revise log out procedure by selecting LOG OUT assuming this happens automatically when the browser is closed.

This bug has also been falsely reported by teachers who have set a task with the "Task availability" set to a date/time in the future. These tasks do not display to the students until the day/time is reached. Please check this is not the case before reporting this issue.

Technical details

The user's local timezone is passed to the backend on login and stored as a custom claim within the auth token so that backend code has access to it without the front-end having to send it on every request. Once we have that timezone data, we then save it to the user table if it's different to what we already hold (null to begin with) so that we can use it as a fall-back from there on in. 

When a user registers, they can start using the system straight away without logging in (a successful registration generates an auth token) which initially was missing the custom claim. Either the timezone isn't coming through to the back-end or the claim is not being generated properly. Auth tokens are generated by the Microsoft.Identity library so we don't have complete control over that codebase.

Logging out clears the old auth token and logging in then ensures the required data is provided, either from the client request or the user table for the rest of the user account's lifetime.