IBX-5094: Added try-catch block for UnauthorizedException#136
Conversation
konradoboza
left a comment
There was a problem hiding this comment.
I think throwing GraphQL\Error\UserError might be more informative than no data returned. POV ping @bdunogier.
alongosz
left a comment
There was a problem hiding this comment.
I think throwing
GraphQL\Error\UserErrormight be more informative than no data returned. POV ping @bdunogier.
return null, will allow you to display the sub-items list but without the section and without the error that is currently going to the logs
Looks like this is a "dangling" class tied to GraphQL only by DI, which makes it difficult to understand what exactly calls it and what is the data flow.
@mateuszdebinski the issue only mentions logs. Does this mean that the output is correct and the issue occurs only in logs?
If we throw GraphQL\Error\UserError instead of our exception, how does that change the output and logs? There's very little information to go on, so it's hard to review this one without spending some time on reverse-engineering.
My idea was to inform ( |
|
@alongosz Yes, this issue did not cause any other issues, apart from the entry in the logs, still, the user could see sub-items. If the user does not have access to the selected section, should we put information into the logs if it does not stop the operation and allows you to still display the information? |
IMHO it's a good idea to show it in logs and GraphiQL client because that might not be expected result, but permission "misconfiguration". The question is how does |
|
@alongosz I tested it, and, UserError doesn't throw any error into the log but in graphQL, you get something like this: where |
It seems that it provides value because someone might expect a section, but not get it and wonder why. |
|
Kudos, SonarCloud Quality Gate passed!
|
micszo
left a comment
There was a problem hiding this comment.
The problem no longer occurs.
QA Approved on Ibexa Commerce 3.3.34-dev
(diff ok on gql v2.3.16)








Jira: https://issues.ibexa.co/browse/IBX-5094