-
Notifications
You must be signed in to change notification settings - Fork 97
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
Better diagnostics and/or default for MELI_MAX_ORGS #244
Comments
You're absolutely right, the current frontend error management lacks the ability to extract error messages from backend errors. The reason is we're doing As Meli is meant to be deployed on your VPS, |
@gemapin It appears somebody already did "extract this to a function". It is called |
Oh yes that's right, I think I created this function and left that aside for some reason. You can definitely reuse that and make the changes you suggested. You can also rename the function, it's a typo 😅 . I'd change the function however, because I realize that the
|
I installed
meli
using in-memory auth. I created an org and everything worked great. Then I decided to implement our SSO system based on Gitlab. I eventually got that working as well. But when I logged in via Gitlab and tried to create an organization, I couldn't. The error message was just a403
+could not create org
. The "could not create org" is coming from the client side. But the server is actually returning "Cannot create more orgs" in its response. It seems the client just fails to read the message provided by the server and render it in the UI.So I looked at the code and specifically the tests to see when a
403
would appear and it was because the limit on organizations had been reached. So then I looked for the default and found that it was just one. I changed my deployment to use a larger number and everything is fine.So I have a few suggestions to avoid this confusion in the future. The first is that you are producing a response in the
403
that includes an error message so the UI should actually render that message. This provides the user with something actionable to address. I also wonder why the default maximum for organizations is one? It is true that I'll probably only use one, but it seems like multiple people might fall into this trap when switching authentication schemes because if I log in via "in memory" I see one set of organizations and if I log in via Gitlab I see an entirely different and mutually exclusive set of organizations. I can imagine other users getting caught in this if they decide to switch authentication methods and a) suddenly all their existing orgs disappear and b) they can't actually see (even if they are using the in-memory credentials which seems like a "root" account) all the organizations so they can't know whether they are exceeding the limit.I'm curious, is there a reason why the default org limit is only 1? Without a diagnostic message that clearly states why the organization creation failed, I could see many users trying to create their second organization and scratching their head as to why that should fail when they managed to create a previous one just fine.
Anyway, just some suggestions to smooth the onboarding process for new users. Getting into the plumbing of how you client does error handling is a bit much for me to bite off with a PR to fix the error handling. But a simple solution might be to just raise the org limit so people are less likely to bump into this issue.
The text was updated successfully, but these errors were encountered: