Skip to content

fix: harden photo upload flow - #4

Merged
g4st3r-d3v merged 1 commit into
mainfrom
feature/photo-upload-hardening
May 17, 2026
Merged

g4st3r-d3v merged 1 commit into
mainfrom
feature/photo-upload-hardening

Conversation

@g4st3r-d3v

@g4st3r-d3v g4st3r-d3v commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Hardened all three mobile photo flows: user avatar, tutor profile photos, and tutor service photos.
  • Added client-side source validation, JPEG resize/compression, 8 MB post-compression limit, FileSystem binary PUT upload with progress, timeout, and retries.
  • Added upload progress UI for service photos, friendlier validation errors, optimistic delete rollback, and a beta smoke checklist.

E2E Trace

  • Avatar: ImagePicker -> validate source type -> compress to JPEG -> request presigned PUT -> upload binary with progress/retry -> confirm avatar -> refetch -> render through existing resolveMediaUrl proxy/presigned URL handling.
  • Tutor profile photos: ImagePicker -> validate/compress -> presign -> upload -> confirm with storage key and prepared metadata -> refetch sorted gallery -> optimistic delete with rollback.
  • Tutor service photos: ServiceWizard photo picker -> validate/compress -> presign -> upload -> confirm -> refetch service photo list -> progress indicator in the photo section.
  • Backend gap found during trace: confirm endpoints trusted client metadata and did not verify that the S3 object existed. Covered in companion core PR: fix: validate uploaded photo objects core#26.

Checks

  • pnpm lint && pnpm typecheck && pnpm test:smoke passed. Existing lint warning remains in src/features/settings/screens/NotificationSettingsScreen.tsx for useEffect dependency load.
  • Targeted upload tests passed earlier: pnpm test -- src/shared/utils/media.test.ts src/features/profile/hooks/photoUploadHooks.test.tsx src/features/services/hooks/useTutorServicePhotos.test.tsx src/features/services/screens/ServiceWizardScreen.photos.test.tsx.
  • Full pnpm test passed earlier: 79 files, 338 tests.

Manual QA

  • Added checklist: docs/PHOTO-UPLOAD-SMOKE-CHECKLIST.md.

Companion

@g4st3r-d3v
g4st3r-d3v marked this pull request as ready for review May 17, 2026 10:22
@g4st3r-d3v
g4st3r-d3v merged commit 3d13b13 into main May 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants