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

failure on adding new user manually from dashboard is missing feedback #23552

Open
Huilensolis opened this issue May 1, 2024 · 14 comments
Open
Labels
bug Something isn't working frontend Related to supabase dashboard needs-analysis Issue status is unknown and/or not possible to triage with the current info

Comments

@Huilensolis
Copy link

Bug report

Describe the bug

if you try to create a new user from the dashboard and it fails, there is no feedback indicating that it went wrong.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to the supabase auth dashboard https://supabase.com/dashboard/project/${projectId}/auth/users
    image

  2. Click on "Add new user"
    image

  3. click on "Create new user"
    image

  4. fill the form

  5. click "Create user"

  6. if it fails, it won't show any UI showing an error

Expected behavior

Show a toast with the API response message

@Huilensolis Huilensolis added the bug Something isn't working label May 1, 2024
@encima
Copy link
Contributor

encima commented May 2, 2024

Hey @Huilensolis

Thanks for opening! I assume you know this failed due to the Developer Console? What error do you see? Just to help us reproduce?

Thanks!

@encima encima added frontend Related to supabase dashboard needs-analysis Issue status is unknown and/or not possible to triage with the current info labels May 2, 2024
@GaryAustin1
Copy link
Contributor

Are you using Brave browser? I've seen users with the popups not showing there.
Also in the Postgres or auth logs is usually the error and 90% of the time an auth.users trigger function failing.

@Huilensolis
Copy link
Author

Are you using Brave browser? I've seen users with the popups not showing there. Also in the Postgres or auth logs is usually the error and 90% of the time an auth.users trigger function failing.

yes, I'm using brave

@GaryAustin1
Copy link
Contributor

image

@Huilensolis
Copy link
Author

Huilensolis commented May 3, 2024

Hey @Huilensolis

Thanks for opening! I assume you know this failed due to the Developer Console? What error do you see? Just to help us reproduce?

Thanks!

I thought that I didn't need to include the "steps to reproduce" because there was just no catch case, but I have realized is not the only possible case, maybe its a bug on the toast and it indeed should pop up but it is not. mb

In my case, it was a Postgres error thrown by a function triggered by "insert" into auth.users, it failed because I was accessing an inexisting key

the function (I named it handle_new_user):

begin
  insert into public.user (id, username, full_name, avatar_url)
  values (new.id, new.raw_user_meta_data->>'try_to_acces_to_undefined_key', new.raw_user_meta_data->>'full_name', new.raw_user_meta_data->>'avatar_url');
  return new;
end;

and to add the trigger I used the SQL editor:

create trigger on_auth_user_created
after insert on auth.users for each row
execute procedure handle_new_user ();

@Huilensolis
Copy link
Author

image

they have shown up on previous occasions when a Postgres error was thrown. i don't think it may be the problem

@GaryAustin1
Copy link
Contributor

So is your real code problem resolved with the auth.users trigger?
And you are just reporting a browser bug with the popup?
That popup shows up in many other browsers for this type of error.

@GaryAustin1
Copy link
Contributor

image
The popup itself is usually not that useful, but at least there is indication of error.
And for that operation is almost always auth.users trigger function.

@Huilensolis
Copy link
Author

So is your real code problem resolved with the auth.users trigger? And you are just reporting a browser bug with the popup? That popup shows up in many other browsers for this type of error.

yes, the real code problem is solved now. I'm just reporting no popup in that case, as I thought they used a optimistic UI, as it creating new users is something supposed to success. so I thought they had no popup for a catch case

@GaryAustin1
Copy link
Contributor

Yes, it is a real bug that needs reporting as far as browser, mainly as you did not provide any info on the browser was bringing that up as I've seen that helping others limited to Brave.

Glad you found the underlying issue.

@GaryAustin1
Copy link
Contributor

Or it is a feature of Brave to block popups.. I don't know.

@Huilensolis
Copy link
Author

image
I tried to create an account with an already-used email and it failed. If Brave blocks the pop-up, it should show an icon on the URL, right?

@GaryAustin1
Copy link
Contributor

Sorry, I don't know, I'm not a UI or SB dev. Just really pointing out Brave/SB has this issue from others I've helped and in case you had not found your underlying issue what it likely was and where to look.

@Huilensolis
Copy link
Author

It is a brave compatibility issue then. if this issue is duplicated, they can close it, thank you for your help @GaryAustin1 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Related to supabase dashboard needs-analysis Issue status is unknown and/or not possible to triage with the current info
Projects
None yet
Development

No branches or pull requests

3 participants