Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user.states.incident incorrect, causing Spinner of Death #581

Closed
2 of 3 tasks
aarontitus opened this issue Oct 30, 2023 · 1 comment
Closed
2 of 3 tasks

user.states.incident incorrect, causing Spinner of Death #581

aarontitus opened this issue Oct 30, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@aarontitus
Copy link
Member

aarontitus commented Oct 30, 2023

Description

Somehow, user_users.states->incident is getting set to an incident to which the user's organization does not have access. It should happen to admins and phone volunteers. I think this is happening when phone volunteers answer calls, and then don't log in for months, then lose access to the incident. I've confirmed 260 instances of users with a mismatched user state.
I logged in as user 75, organization 130 (voad@aa...), and the login never completes, getting stuck in the endless spinner of death.

Expected Behavior

Get user_users.states->>incident

  1. If the user is an admin, then allow it to load.
  2. If the user is a phone volunteer AND the incident is more than 2 months old, AND the user's organization does not have access, then then it should revert to the most recent incident to which the organization DOES have access.
  3. If the user is not a phone volunteer or admin AND the organization does not have access to the user states incident, then it should revert to the most recent incident to which the organization DOES have access.

Current Behavior

Unfortunately, this particular bug is not solvable by the user. Logging in via an incognito browser does not work. Clearing states would work, but that requires the user to be able to log in. It currently requires a manual database update.

Screenshots

Spinner of death on https://www.crisiscleanup.org/dashboard

Steps to Reproduce

User 75 belongs to organization 130, which does NOT have access to incident 385.

  1. Log in as User 75 (voad@aa...)
  2. Manually update the user's states in the database: UPDATE user_users SET states = '{"incident": 385}' WHERE id = 75;
  3. Without refreshing, visit https://www.crisiscleanup.org/dashboard
  4. Note: This will not work with admin accounts, since they have defacto access to all incidents.

Tasks

  • Find out why this is happening
  • Aaron to add this to housekeeping();
  • Fix expected behavior.
@aarontitus aarontitus added the bug Something isn't working label Oct 30, 2023
@deepanchal deepanchal removed their assignment Jan 10, 2024
@aarontitus
Copy link
Member Author

Superseded by #687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants