immich/mobile/lib
Timon f0cf3311d5
feat(mobile): Allow users to set profile picture from asset viewer (#25517)
* init

* fix

* styling

* temporary workaround for 500 error

**Root cause:**
The autogenerated Dart OpenAPI client (`UsersApi.createProfileImage()`) had two issues:
1. It set `Content-Type: multipart/form-data` without a boundary, which overrode the correct header that Dart's `MultipartRequest` would set (`multipart/form-data; boundary=...`).
2. It added the file to both `mp.fields` and `mp.files`, creating a duplicate text field.

**Result:**
Multer on the server failed to parse the multipart body, so `@UploadedFile()` was `undefined` → accessing `file.path` in `UserService.createProfileImage()` threw → **500 Internal Server Error**.

**Workaround:**
Bypass the autogenerated method in `UserApiRepository.createProfileImage()` and send the multipart request directly using the same `ApiClient` (basePath + auth), ensuring:
- No manual `Content-Type` header (let `MultipartRequest` set it with boundary)
- File only in `mp.files`, not `mp.fields`
- Proper filename fallback

* Revert "temporary workaround for 500 error"

This reverts commit 8436cd402632ca7be9272a1c72fdaf0763dcefb6.

* generate route for ProfilePictureCropPage

* add route import

* simplify

* try this

* Revert "try this"

This reverts commit fcf37d2801055c49010ddb4fd271feb900ee645a.

* try patching

* Reapply "temporary workaround for 500 error"

This reverts commit faeed810c21e4c9f0839dfff1f34aa6183469e56.

* Revert "Reapply "temporary workaround for 500 error""

This reverts commit a14a0b76d14975af98ef91748576a79cef959635.

* fix upload

* Refactor image conversion logic by introducing a new utility function. Replace inline image-to-Uint8List conversion with the new utility in EditImagePage, DriftEditImagePage, and ProfilePictureCropPage.

* use toast over snack

* format

* Revert "try patching"

This reverts commit 68a616522a1eee88c4a9755a314c0017e6450c0f.

* Enhance toast notification in ProfilePictureCropPage to include success type for better user feedback.

* Revert "simplify"

This reverts commit 8e85057a40.

* format

* add tests

* refactor to use statefulwidget

* format

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
2026-02-22 06:02:33 +00:00
..
constants feat(mobile): enhance album sorting functionality with order handling (#24816) 2026-02-07 10:11:37 +05:30
domain feat: tap to see next/previous image (#20286) 2026-02-22 05:28:17 +00:00
entities chore: use hosted isar flutter libs (#22757) 2025-10-08 04:19:46 -05:00
extensions feat(mobile): inline asset details (#25952) 2026-02-17 09:24:34 -06:00
infrastructure feat(mobile): filter by tags (#26196) 2026-02-18 21:16:26 +00:00
interfaces refactor(mobile): interfaces refactor (#19415) 2025-06-23 11:27:44 -05:00
mixins chore: flutter 3.29.1 (#16730) 2025-03-10 21:46:36 -05:00
models feat(mobile): filter by tags (#26196) 2026-02-18 21:16:26 +00:00
pages feat(mobile): Allow users to set profile picture from asset viewer (#25517) 2026-02-22 06:02:33 +00:00
platform fix(mobile): mtls on native clients (#25802) 2026-02-05 17:42:53 +00:00
presentation feat(mobile): Allow users to set profile picture from asset viewer (#25517) 2026-02-22 06:02:33 +00:00
providers feat(mobile): Allow users to set profile picture from asset viewer (#25517) 2026-02-22 06:02:33 +00:00
repositories fix(mobile): cancel share download when dialog is dismissed (#25466) 2026-02-05 19:08:35 +00:00
routing feat(mobile): Allow users to set profile picture from asset viewer (#25517) 2026-02-22 06:02:33 +00:00
services feat(mobile): Allow users to set album cover from mobile app (#25515) 2026-02-22 05:53:39 +00:00
theme fix(mobile): prevent nav bar label text wrapping (#26011) 2026-02-12 16:57:03 +00:00
utils feat(mobile): Allow users to set profile picture from asset viewer (#25517) 2026-02-22 06:02:33 +00:00
widgets feat(mobile): video zooming in asset viewer (#22036) 2026-02-21 23:37:36 -06:00
main.dart chore: remove unused key and fix casing for recent_albums (#24691) 2026-02-12 16:06:22 +01:00
wm_executor.dart fix: isolate freeze app on older ios device (#22509) 2025-10-22 12:43:03 -05:00