Skip to content

fix(storages): block UI editing of file volumes exceeding 5 MiB - #9851

Merged
andrasbacsai merged 1 commit into
nextfrom
4701-storages-page-unusable
Apr 28, 2026
Merged

andrasbacsai merged 1 commit into
nextfrom
4701-storages-page-unusable

Conversation

@andrasbacsai

Copy link
Copy Markdown
Member

Summary

  • Adds MAX_CONTENT_SIZE (5 MiB), BINARY_PLACEHOLDER, and TOO_LARGE_PLACEHOLDER constants to LocalFileVolume
  • loadStorageOnServer now checks remote file size via stat/wc -c before reading; stores placeholder instead of full content when limit exceeded
  • Adds is_too_large computed attribute (appended for Livewire serialization)
  • FileStorage Livewire component marks oversized files read-only and short-circuits submit/instantSave with an error dispatch
  • Storage component truncates already-stored oversized content to placeholder on refresh, preventing large payload serialization to browser
  • Blade template shows distinct warning banner for oversized files and hides Save/Convert controls

Fixes #4701 — browser tab crash when Docker volumes mount large host files.


Fixes #4701

Large host files mounted via Docker volumes caused the storages page to
become unusable — full file content was stored in the encrypted mediumText
column and serialised into the Livewire payload, crashing the browser.

- Add MAX_CONTENT_SIZE (5 MiB), BINARY_PLACEHOLDER, and TOO_LARGE_PLACEHOLDER
  constants to LocalFileVolume
- Check remote file size via stat/wc before cat in loadStorageOnServer and
  saveStorageOnServer; store placeholder instead of content when limit exceeded
- Expose is_too_large computed attribute (appended for Livewire serialisation)
- Guard submit, instantSave, and syncData in FileStorage Livewire component
- Truncate oversized content in Storage::refreshStorages to prevent payload bloat
- Show distinct warning banner in file-storage blade; mark textarea readonly and
  hide Save/Convert buttons for too-large files
- Add unit tests covering constants, computed flags, and toArray serialisation

Fixes #4701
@andrasbacsai
andrasbacsai merged commit 9af0351 into next Apr 28, 2026
5 checks passed
@andrasbacsai
andrasbacsai deleted the 4701-storages-page-unusable branch April 28, 2026 20:41
@andrasbacsai andrasbacsai mentioned this pull request May 11, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant