Skip to content

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)) against consume_uploaded_entries/3 output never matched (the function unwraps {:ok, val} into bare val).
  • Storage error crash — returning {:error, reason} from the consume_uploaded_entries/3 callback 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 before consume_uploaded_entries/3, which previously raised on them.
  • KeyError after upload — file.original_name → file.original_file_name in the admin pending-files list (the schema field name; the old reference crashed the LiveView and reset pending_files).
  • Image classification — files were hardcoded as "document", so images never got bucket placement or thumbnail variants. Now classified via PhoenixKitCustomerSupport.Uploads.file_type_from_mime/1 from entry.client_type.

Changed

  • Uploads are consumed in the LiveView progress callback (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_errors instead of being logged-only.
  • Internal: extracted PhoenixKitCustomerSupport.Uploads.consume_entry/4 and cancel_errored_entries/2 to deduplicate the upload pipeline across Web.New, Web.UserNew, and Web.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.