High Priority: NULL user.states.incident value causes Spinner of Death
Opened this issue · 1 comments
Description
When user_users.states.incident
is null
, and a user logs in, they are taken to the spinner of death. For some users, this happens very regularly. It even happens once they're logged in. It has been a pain point for several users, and about 205 currently have their user.states set to NULL.
Expected Behavior
If the user.states.incident is null
, then it should automatically be reset to the most recent incident to which the organization has access. And the URL /incident/undefined/work should be handled the same way.
Current Behavior
When user.states.incident = null, and they are on Work, the user is forwarded to a URL like crisiscleanup.org/incident/undefined/work/282613?showOnMap=true
. This is an invalid URL, and you get the spinner of death. See screenshot below.
Screenshots
Steps to Reproduce
UPDATE user_users SET states = states || '{"incident": null}' WHERE id = 14;
- Log in.
- Bug: Spinner of death.
- Manually visit a valid URL that contains the incident_id in the URL, like https://www.crisiscleanup.org/incident/286/work
- User states is updated, and the site works as expected.
Tasks
- Forward crisiscleanup.org/incident/undefined/work/ to the most recent incident to which the organization has access.
- If user.states.incident is
null
, then reset to the most recent incident to which the organization has access. - On the blank spinner of death screen, add a white button that says "Start Over." this button does two things: 1. Sets user.states.incident to the most recent incident, then 2. Logs out.
For what it's worth, this error does not appear to be browser specific. It's happening to Safari, Chrome, Firefox, and Edge.