fix(appstore): Ensure returned apps from AppStore are valid#47854
fix(appstore): Ensure returned apps from AppStore are valid#47854
Conversation
b1246a9 to
ae17f47
Compare
come-nc
left a comment
There was a problem hiding this comment.
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. |
provokateurin
left a comment
There was a problem hiding this comment.
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 <[email protected]> fix: lint chore: remove space Signed-off-by: Git'Fellow <[email protected]> fix: check if response array is null Signed-off-by: Git'Fellow <[email protected]> chore: Add log
f02902c to
8585b05
Compare
|
Done ✅ |
|
/backport to stable30 |
|
/backport to stable29 |
|
/backport to stable28 |
Co-authored-by: Côme Chilliet <[email protected]> Signed-off-by: Git'Fellow <[email protected]>
Checklist