TryGhost
OSS
Ghost
Sign in / Sign up
Open main menu
Ghost
GitHub
Overview
Runs
Analytics
Loading workspace stats
Loading workspace insights...
Statistics interval
7 days
30 days
Latest CI Pipeline Executions
Status
Fix filter
Filter
Fuzzy
Filter range
Sort by
Sort by
Start time
Sort ascending
Sort descending
Failed
main
1806920f 🐛 Improved upload error messages in the editor (#28723) ref https://linear.app/ghost/issue/ONC-1847/cant-upload-files ## Context This contributes to ONC-1847 (file uploads in the editor failing with no useful feedback). It does **not** close the issue on its own — see "Scope" below. ## Problem When an upload in the editor failed (e.g. a file exceeding the plan's upload-size limit), the error surfaced to the user was unhelpful: - The card showed a generic **"Host Limit error, cannot upload image."** instead of the actionable message (e.g. "Your plan supports uploads up to X. Please upgrade to upload larger files."). - Repeated failed uploads **stacked duplicate** error messages. ## Fix `apps/admin-x-framework/src/hooks/use-koenig-file-upload.ts`: 1. **Wrong message shown.** The API (`@tryghost/mw-error-handler`) wraps some errors with a generic `message` and puts the specific, user-facing text in `context`. The hook surfaced `message`. It now prefers `context`, falling back to `message` — matching the existing `getErrorMessage` convention used elsewhere in the admin. 2. **Duplicate errors.** The hook appended each failure to the existing `errors` array, so retrying a failing upload accumulated duplicates. It now clears errors at the start of each attempt and **replaces** rather than appends on failure. ## Tests Added unit tests covering both behaviours (prefer `context`; no accumulation across retries). All 15 hook tests pass. ## Scope The actual ONC-1847 symptom — the **file card showing no error at all** when an upload fails — is caused by the file card's error rendering in `@tryghost/koenig-lexical` and is fixed there in **TryGhost/Koenig#1994**. This PR is a prerequisite: it fixes the error *text* (visible today on the image card) and the duplicate-message behaviour. Once Koenig#1994 is published and bumped in Ghost, the file card will show the correct, non-duplicated message and ONC-1847 is fully resolved. ## Before https://github.com/user-attachments/assets/90e8471e-e6c6-47c7-8314-fc94769004dc ## After https://github.com/user-attachments/assets/7aa55164-14ee-4c85-abe1-38d9593e388c
by Michael Ba...
M
Succeeded
fix-koenig-upload-error-messages
f4db1ff7 Merge 05cb7ff60a4b32b20bb3785def3b9016772c67ac into b8cabcee2024d2e7fa736e4c891fb5637ec46836
by Michael Ba...
M
Failed
fix-koenig-upload-error-messages
f4db1ff7 Merge 05cb7ff60a4b32b20bb3785def3b9016772c67ac into b8cabcee2024d2e7fa736e4c891fb5637ec46836
by Michael Ba...
M
Succeeded
fix-koenig-upload-error-messages
2af7b680 Merge 32d4352463dddcc5bbf43532f9f5cddbdc0806ed into 931b1540f635928371d24ccf7ccd89892d0cb3e6
by Michael Ba...
M
Previous page
Previous
Next
Next page