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

Distinguish between "no user found" and "cannot contact the DB" #370

Open
sevenseacat opened this issue Jul 21, 2023 · 1 comment
Open

Comments

@sevenseacat
Copy link
Member

We had a case recently where the DB host in our app went down, but the homepage of our app continued to render, despite performing database queries relating to showing current-user-specific information.

AshAuthentication swallows errors relating to database connectivity under a "user not found", as part of looking up the user that a JWT belongs to - https://github.com/team-alembic/ash_authentication/blob/main/lib/ash_authentication.ex#L221-L234 - and also as part of sign in (but I'm not sure where that happens).

So in our case, the web app behaved as if no-one was logged in (even when they were), but would not allow sign-in (because DB connection errors there were also being swallowed?) which wasn't an optimal scenario!

@jimsynz
Copy link
Collaborator

jimsynz commented Nov 15, 2023

Yeah, I think what we should do is special case database errors and (re)raise them.

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

No branches or pull requests

2 participants