You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Libraries panel crashes when the cloud rejects a save #537
If the cloud fails to create a library item, the plugin still answers the save request with HTTP 200 and an empty body, and the Libraries panel crashes with "There seems to be an error. Cannot read properties of undefined (reading 'labels')". The user gets no message about what went wrong, and the item is not saved.
Steps
Run the cloud API with a small upload limit (PHP's default post_max_size of 8 MB reproduces it locally).
In Assistant, open a library, choose Add Items, and add a long page so the upload with its screenshot exceeds the limit (18 MB when this was found).
The request finishes, then the panel is replaced by the error.
Cause
CloudLibraries::create_item() reads $result->id without checking the response; a rejected upload decodes to null (PHP warning "Attempt to read property "id" on null" at backend/src/Clients/Cloud/CloudLibraries.php:26).
LibraryItemPostController::save_to_library() only treats success === false as an error, so a null response is returned as a success.
The UI then renders the missing item.
Expected
A failed or empty cloud response comes back as an error with a message the UI shows, and the panel stays usable.
Activity