fix(clients): delete profile photos through deleteClientProfilePhoto - #2406
Merged
Merged
Conversation
`updateClientProfilePhoto` is deprecated, but `ProfilePhotoModal` was still using it as the delete path by sending `photo: null`, while `deleteClientProfilePhoto` sat implemented, permissioned and uncalled. The modal now uses the latter. This ships on its own so installed clients start picking it up immediately. The backend cannot drop `updateClientProfilePhoto` until they have. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR reroutes profile-photo deletion from the deprecated Sequence diagram for profile photo deletionsequenceDiagram
actor User
participant ProfilePhotoModal
participant GraphQLAPI
participant ClientProfile
User->>ProfilePhotoModal: deleteFile()
ProfilePhotoModal->>GraphQLAPI: deleteClientProfilePhoto(clientProfileId)
GraphQLAPI-->>ProfilePhotoModal: OperationInfo
ProfilePhotoModal->>GraphQLAPI: refetch ClientProfileDocument(id)
GraphQLAPI-->>ClientProfile: updated profile without photo
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
vecchp
pushed a commit
that referenced
this pull request
Sep 1, 2026
`createClientDocument` was the last multipart upload mutation. The presigned pipeline replaced it in #2018, which deleted the components that called it, and nothing has called it since: no `.graphql` document, no generated operation, no component, and zero occurrences in the compiled mobile bundle — against one occurrence of `updateClientProfilePhoto` in the same bundle, so the search is sound rather than a false negative. Its only remaining consumers were backend test fixtures. Reviewing the previous commit surfaced that this path was also entirely unvalidated — no size limit and no content-type allowlist, because `CLIENT_DOCUMENT_CONFIG` is only ever applied on the presigned side. Rather than add a validator and an exception class to code nobody reaches, remove the path: - the `create_client_document` mutation and `CreateClientDocumentInput` - `create_multipart_attachment`, added in the previous commit and now orphaned - `python-magic`, whose only two call sites were the deleted `Attachment.save()` override and this service `_create_client_document_fixture` now builds its document through the presigned mutations, so the ~28 test call sites keep working. Two tests went with the mutation: `test_create_client_document`, and `test_create_client_document_permission`, which duplicated `test_resolve_client_document_uploads_permission` parameter for parameter. `updateClientProfilePhoto` stays. It is present in the shipped bundle, so it has to outlive the app taking #2406, which moves photo deletion onto `deleteClientProfilePhoto`. #2405 removes it once that rollout is confirmed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
🚀 Expo continuous deployment is ready for betterangels!
iOS Simulator Build: Simulator Build Link |
vecchp
pushed a commit
that referenced
this pull request
Sep 1, 2026
`createClientDocument` was the last multipart upload mutation. The presigned pipeline replaced it in #2018, which deleted the components that called it, and nothing has called it since: no `.graphql` document, no generated operation, no component, and zero occurrences in the compiled mobile bundle — against one occurrence of `updateClientProfilePhoto` in the same bundle, so the search is sound rather than a false negative. Its only remaining consumers were backend test fixtures. Reviewing the previous commit surfaced that this path was also entirely unvalidated — no size limit and no content-type allowlist, because `CLIENT_DOCUMENT_CONFIG` is only ever applied on the presigned side. Rather than add a validator and an exception class to code nobody reaches, remove the path: - the `create_client_document` mutation and `CreateClientDocumentInput` - `create_multipart_attachment`, added in the previous commit and now orphaned - `python-magic`, whose only two call sites were the deleted `Attachment.save()` override and this service `_create_client_document_fixture` now builds its document through the presigned mutations, so the ~28 test call sites keep working. Two tests went with the mutation: `test_create_client_document`, and `test_create_client_document_permission`, which duplicated `test_resolve_client_document_uploads_permission` parameter for parameter. `updateClientProfilePhoto` stays. It is present in the shipped bundle, so it has to outlive the app taking #2406, which moves photo deletion onto `deleteClientProfilePhoto`. #2405 removes it once that rollout is confirmed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
tglaz
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #2402 so it can ship on its own.
updateClientProfilePhotois deprecated, butProfilePhotoModalwas still using it as the delete path — sendingphoto: null— whiledeleteClientProfilePhotosat implemented, permissioned and uncalled onmain. The modal now uses the latter.Why separately
Nothing here depends on #2402:
deleteClientProfilePhotohas been onmainsince before it. Keeping the swap inside a large breaking backend PR meant the EAS rollout clock did not start until that PR cleared review — and the backend cannot dropupdateClientProfilePhoto(#2405) until installed clients have taken this update.It also isolates the manual QA. This is the only part of the original PR that needs checking in the app; #2402's backend work is covered by tests.
Worth a manual check
Photo deletion in the app.
deleteClientProfilePhotohas backend tests and TypeScript enforces the new variable shape, but this mutation has never run in production. No component test: the delete flows throughDeleteModaland would need substantial native-UI mocking for what is a wiring swap.Verification
graphql-codegenregenerated againstmain's schema; the diff is confined to the swapped mutationtsc --noEmit -p tsconfig.lib.jsoncleanvitest run— 22 files, 172 tests passed🤖 Generated with Claude Code
Summary by Sourcery
Bug Fixes:
deleteClientProfilePhotomutation instead of the deprecated update mutation.