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

[Bug]: Balance on /user/[id] page sometimes is current user's balance #258

Closed
rinkp opened this issue Jul 18, 2024 · 2 comments · Fixed by #260
Closed

[Bug]: Balance on /user/[id] page sometimes is current user's balance #258

rinkp opened this issue Jul 18, 2024 · 2 comments · Fixed by #260

Comments

@rinkp
Copy link
Member

rinkp commented Jul 18, 2024

What browsers are you seeing the problem on?

Firefox, Microsoft Edge

Is this happening on the SudoSOS point of sale or on the SudoSOS dashboard?

Dashboard

Current behaviour

Sometimes, when going to another user through /user/[id], the balance of the signed-in user is shown instead of the [id] user's balance

image

Desired behaviour

The expected behaviour is that the [id] user's balance is shown on their page

Steps to reproduce

  1. Go to /user-overview
  2. Search for a user
  3. Open the user

Other information

What bacpm and I think is happening is that one of two things happens:

  1. There is a race condition, and sometimes the balance is replaced the one way, and sometimes the balance is replaced the other way
  2. Something goes wrong with fetching the [id] user's balance and it is not shown. However, the network request was successful even when the issue occurred.

Known workaround

I have showed the bacpm to view the network requests to see the balance. Alternatively, a CTRL+F5 works.

@CodeNamedRobin
Copy link
Contributor

This seems to work on development already? We might want to update main and redeploy to see if it still is a problem.

@rinkp
Copy link
Member Author

rinkp commented Jul 19, 2024

But since this balance component is a separate component, don't we simply want to remove the case where this balance component is filled with the balance of the user that is signed in?

await userStore.fetchCurrentUserBalance(auth.getUser.id, apiService);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants