-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(appstore): Ensure returned apps from AppStore are valid #47854
Conversation
b1246a9
to
ae17f47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not fix the linked TypeError from what I understand.
The problem of the TypeError is more that $response['data']
was not set I suppose?
Any idea what the response looked like? Because if it was empty it would return early line 57 already.
My analysis was that some elements of By adding the |
No @come-nc's analysis is right:
will give you
Which is exactly the same error message. The error message clearly mentions the method and the argument. Running
results in no error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if (empty($response)) {
check further up should be extended to be if (empty($response) || $response['data'] === null) {
.
If no callback is given to array_filter it will remove all falsy values which includes null, so null is not an invalid element in the given array. |
d4f8e65
to
f02902c
Compare
Thanks for your inputs, six eyes see better than two 🤣 |
I wonder if we should have a warning log for the return case to inform the admin that the appstore returned a faulty response? Otherwise it is just silent and they can't know why. |
Agree. Maybe something like:
This should inform admin that response was not valid, but also this could be temporary and it can be retried (in case appstore is down for maintenance, overloaded...). |
Sounds good, but I would either omit the app parameter or set it to core. |
All the other warnings have it, that's why I've included it. 🤔 |
Ah ok, then it's good. Can you add it to the PR? |
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: lint chore: remove space Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: check if response array is null Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> chore: Add log
f02902c
to
8585b05
Compare
Done ✅ |
/backport to stable30 |
/backport to stable29 |
/backport to stable28 |
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Checklist