-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Bug Report
Summary
Two related bugs in the account upgrade ID document upload flow:
Bug 1 — InvalidFileTypeError not mapped in error-map.ts
src/graphql/error-map.ts has no case for InvalidFileTypeError, so it falls through to assertUnreachable() which throws:
Error: This should never compile with InvalidFileTypeError
This surfaces to the mobile client as a cryptic ApolloError instead of a user-friendly validation message.
File: src/graphql/error-map.ts
Fix: Add a case for InvalidFileTypeError that returns a ValidationInternalError with the existing descriptive message from the error class (Invalid file type: X. Allowed: image/jpeg, image/png, image/webp).
Bug 2 — image/heic not in ALLOWED_CONTENT_TYPES
iOS devices (and the iOS simulator via react-native-image-picker) return image/heic as the content type for photos. The backend only accepts ["image/jpeg", "image/png", "image/webp"], rejecting all HEIC uploads.
File: src/services/storage/index.ts line 16
Fix: Add "image/heic" to ALLOWED_CONTENT_TYPES.
Impact
The account upgrade flow ID document upload is completely broken on iOS — every photo library selection fails with the cryptic error above.
Reproduction
- Build
feat/business-accountbranch on iOS simulator - Go through account upgrade flow to Pro/Merchant
- Attempt to upload an ID document from photo library
- →
ApolloError: This should never compile with InvalidFileTypeError
Related
- PR #400 (
feat/business-account) — account upgrade flow src/services/storage/errors.ts—InvalidFileTypeErrorclass definitionsrc/services/storage/index.ts—isValidContentType()function