You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chat - Custom avatar is not displayed on a group chat #85726
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Please re-state the problem that we are trying to solve in this issue.
When creating a group chat via FAB > Start chat > Add members, if the user sets a custom avatar during creation, the avatar is not displayed after saving. This is reproducible in staging (v9.3.40-0) but not in production (v9.3.39-3), indicating a recent regression.
What is the root cause of that problem?
The most likely root cause is PR #85231 ("Fix - heic context lost"), which changed the web implementation of cropOrRotateImage from the deprecated manipulateAsync API to the new ImageManipulator.manipulate() chain API. This PR was merged on March 17 and is in staging but not yet in production — perfectly matching the bug's staging-only reproducibility.
How the avatar flow works:
User selects/crops an avatar image in AvatarWithImagePicker → AvatarCropModal calls cropOrRotateImage() (src/libs/cropOrRotateImage/index.ts) to produce a File object
On "Start group", navigateToAndCreateGroupChat builds an optimistic report with avatarUrl = avatarUri (local blob URL) for immediate display, and passes the actual File to createGroupChat (src/libs/actions/Report/index.ts:2039-2057)
ImageManipulator.manipulate(uri).crop(...).renderAsync().then(ref=>ref.saveAsync({compress, format})).then((result)=>{/* same fetch blob, create File */});
The new ImageManipulator.manipulate() chain API on web uses an HTML canvas internally. There is a known issue with saveAsync not properly respecting format and compression. If renderAsync() or saveAsync() produces an invalid or empty result on web, the resulting File object would be empty/corrupted. This would cause:
The fetch(result.uri) to return an empty blob → 0-byte File created
The server receives an empty/invalid file upload → avatar is not stored
The server response doesn't include a valid avatarUrl → the optimistic local blob URL gets overwritten → default avatar is displayed
The display logic in getIconsForGroupChat (src/libs/ReportUtils.ts:3821-3833) uses report.avatarUrl || getDefaultGroupAvatar(report.reportID), so any empty/null/undefined avatarUrl falls back to the default.
What changes do you think we should make in order to solve the problem?
Verify the regression source: Confirm this is caused by PR Fix - heic context lost #85231 by testing group chat avatar creation on the branch prior to that PR's merge. If confirmed, revert PR Fix - heic context lost #85231 as this is a deploy blocker.
If reverting: Revert src/libs/cropOrRotateImage/index.ts back to using the deprecated manipulateAsync API until the new ImageManipulator.manipulate() chain API is confirmed to work correctly on web for all image types.
If fixing forward: Debug the specific failure point in the new ImageManipulator.manipulate() → renderAsync() → saveAsync() chain on web. The issue is likely that saveAsync on web (which uses canvas.toBlob() or canvas.toDataURL() internally) either fails silently or produces empty output for certain input URIs (e.g., blob URLs from the browser's file picker). Adding validation of the result (check result.uri is non-empty and the fetched blob has non-zero size) with a fallback to the old API would prevent this class of failure.
What alternative solutions did you explore? (Optional)
SequentialQueue changes (PR [No QA] Fix lost/duplicated requests in PersistedRequests (Issues 2, 3, 4, 5) #84622): Also merged into staging but less likely to be the cause. The avatar upload happens when online, so the File object should still be valid when the request is processed. However, if the new async push() creates a timing gap where the blob URL is revoked before the request is sent, this could contribute.
Server-side issue: Ruled out because staging and production share the same server, yet the bug only reproduces on the staging client build.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
It looks like the issue was caused by the refactor from the deprecated manipulateAsync to the new ImageManipulator.manipulate() API.
I will share the PR with the fix soon, where I reverted to the previous approach, which only affects the web. So the initial fix for #81702 should remain untouched
Activity
melvin-bot commentedon Mar 19, 2026
Triggered auto assignment to @arosiclair (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Mar 19, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 19, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Mar 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When creating a group chat via FAB > Start chat > Add members, if the user sets a custom avatar during creation, the avatar is not displayed after saving. This is reproducible in staging (v9.3.40-0) but not in production (v9.3.39-3), indicating a recent regression.
What is the root cause of that problem?
The most likely root cause is PR #85231 ("Fix - heic context lost"), which changed the web implementation of
cropOrRotateImagefrom the deprecatedmanipulateAsyncAPI to the newImageManipulator.manipulate()chain API. This PR was merged on March 17 and is in staging but not yet in production — perfectly matching the bug's staging-only reproducibility.How the avatar flow works:
AvatarWithImagePicker→AvatarCropModalcallscropOrRotateImage()(src/libs/cropOrRotateImage/index.ts) to produce aFileobjectNewChatConfirmPagestores the File in component state (avatarFile) and the URI string in Onyx draft (avatarUri) (src/pages/NewChatConfirmPage.tsx:148-158)navigateToAndCreateGroupChatbuilds an optimistic report withavatarUrl = avatarUri(local blob URL) for immediate display, and passes the actualFiletocreateGroupChat(src/libs/actions/Report/index.ts:2039-2057)createGroupChatincludes the file in theOpenReportAPI call viaparameters.file = avatar(src/libs/actions/Report/index.ts:1864-1867)avatarUrlwith a permanent URL in the response onyxDataWhat the PR changed:
The old code (production) used:
The new code (staging) uses:
The new
ImageManipulator.manipulate()chain API on web uses an HTML canvas internally. There is a known issue withsaveAsyncnot properly respecting format and compression. IfrenderAsync()orsaveAsync()produces an invalid or empty result on web, the resultingFileobject would be empty/corrupted. This would cause:fetch(result.uri)to return an empty blob → 0-byte File createdavatarUrl→ the optimistic local blob URL gets overwritten → default avatar is displayedThe display logic in
getIconsForGroupChat(src/libs/ReportUtils.ts:3821-3833) usesreport.avatarUrl || getDefaultGroupAvatar(report.reportID), so any empty/null/undefinedavatarUrlfalls back to the default.What changes do you think we should make in order to solve the problem?
Verify the regression source: Confirm this is caused by PR Fix - heic context lost #85231 by testing group chat avatar creation on the branch prior to that PR's merge. If confirmed, revert PR Fix - heic context lost #85231 as this is a deploy blocker.
If reverting: Revert
src/libs/cropOrRotateImage/index.tsback to using the deprecatedmanipulateAsyncAPI until the newImageManipulator.manipulate()chain API is confirmed to work correctly on web for all image types.If fixing forward: Debug the specific failure point in the new
ImageManipulator.manipulate()→renderAsync()→saveAsync()chain on web. The issue is likely thatsaveAsyncon web (which usescanvas.toBlob()orcanvas.toDataURL()internally) either fails silently or produces empty output for certain input URIs (e.g., blob URLs from the browser's file picker). Adding validation of the result (checkresult.uriis non-empty and the fetched blob has non-zerosize) with a fallback to the old API would prevent this class of failure.What alternative solutions did you explore? (Optional)
SequentialQueue changes (PR [No QA] Fix lost/duplicated requests in PersistedRequests (Issues 2, 3, 4, 5) #84622): Also merged into staging but less likely to be the cause. The avatar upload happens when online, so the File object should still be valid when the request is processed. However, if the new async
push()creates a timing gap where the blob URL is revoked before the request is sent, this could contribute.Server-side issue: Ruled out because staging and production share the same server, yet the bug only reproduces on the staging client build.
Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.IuliiaHerets commentedon Mar 19, 2026
Chrome / v9.3.40-4 PR:85752
Reproduced
d85733686bea72289945652d64023d24.mp4
rinej commentedon Mar 19, 2026
It looks like the issue was caused by the refactor from the deprecated
manipulateAsyncto the newImageManipulator.manipulate()API.I will share the PR with the fix soon, where I reverted to the previous approach, which only affects the web. So the initial fix for #81702 should remain untouched
9 remaining items
rinej commentedon Mar 19, 2026
Thanks for the picture!
I updated the branch, and on dev locally looks good
Could you test the with the newest changes?
Heres the video with the posted image:
https://github.com/user-attachments/assets/42206d95-e5ce-485a-91a6-d28b65cdf045
cristipaval commentedon Mar 19, 2026
I just triggered a new adhoc build
m-natarajan commentedon Mar 19, 2026
Passed, Chrome, 9.3.40-8 (Kind of delay observed, Latest staging)
Screen.Recording.2026-03-19.at.17.09.30.mp4
mountiny commentedon Mar 19, 2026
Seem slike this is fixed in staging
mountiny commentedon Mar 19, 2026
@rinej was the bug not from your change then?
rinej commentedon Mar 19, 2026
If it works on staging, then it looks like it 😅 So no changes are needed from that PR
cristipaval commentedon Mar 19, 2026
lovely