mirror of
https://github.com/immich-app/immich.git
synced 2026-02-28 09:38:43 +03:00
**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