Customer Support 0.1.1: Ticket attachments upload again
Customer Support 0.1.1 fixes attachments on support tickets. In 0.1.0 a file uploaded with a new ticket or a reply was dropped without a word, so tickets ended up with no attachments.
Uploads now go through, on the admin’s new ticket page and on the user’s new ticket and ticket pages. A file appears under Attached files: as soon as it finishes uploading, instead of waiting for the form to be sent. A file of the wrong type or over the size limit no longer leaves the page hanging, and a storage failure shows an error instead of crashing the page. Images are now stored as images, so they get thumbnails. In the admin, an attachment opens the original file in a new tab, as it already did for users.
Full release notes: Customer Support 0.1.1
0.1.1 · 5 May 2026
Fixed
- Ticket attachment uploads (#2) — successful uploads were silently dropped because
Enum.filter(&match?({:ok, _}, &1))againstconsume_uploaded_entries/3output never matched (the function unwraps{:ok, val}into bareval). - Storage error crash — returning
{:error, reason}from theconsume_uploaded_entries/3callback violates the{:ok, term} | {:postpone, term}contract and crashed the LiveView. - Hang on invalid file type — errored upload entries (
:not_accepted,:too_large) now get cancelled beforeconsume_uploaded_entries/3, which previously raised on them. KeyErrorafter upload —file.original_name→file.original_file_namein the admin pending-files list (the schema field name; the old reference crashed the LiveView and resetpending_files).- Image classification — files were hardcoded as
"document", so images never got bucket placement or thumbnail variants. Now classified viaPhoenixKitCustomerSupport.Uploads.file_type_from_mime/1fromentry.client_type.
Changed
- Uploads are consumed in the LiveView
progresscallback (auto_upload: true), so files appear in “Attached files” immediately after drop instead of staying in “Uploading…” until form submit. - Admin attachment tiles wrap in
<a target="_blank" rel="noopener noreferrer">to match user-side behaviour and click through to the original file. - Storage errors now surface in the UI via
:upload_errorsinstead of being logged-only. - Internal: extracted
PhoenixKitCustomerSupport.Uploads.consume_entry/4andcancel_errored_entries/2to deduplicate the upload pipeline acrossWeb.New,Web.UserNew, andWeb.UserDetails(~160 LOC removed).
Customer Support 0.1.1. Install or update: {:phoenix_kit_customer_support, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.