Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.59k stars 2.92k forks source link

[HOLD for payment 2024-08-01] [$50] Group chat - Avatar loads infinitely when refreshing full screen avatar on confirmation page #45824

Closed lanitochka17 closed 3 months ago

lanitochka17 commented 4 months ago

If you havenโ€™t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.10-2 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team

Action Performed:

. Go to staging.new.expensify.com

  1. Go to FAB > Start chat > Chat
  2. Select a few users
  3. Proceed to confirmation page
  4. Add a group chat avatar
  5. On confirmation page, click on the group chat avatar
  6. Click View avatar
  7. Refresh the page

Expected Result:

Avatar will load after refreshing the page

Actual Result:

Avatar loads infinitely when refreshing full screen avatar on confirmation page

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/d52a99e0-681c-4524-93ad-4811b972243e

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0163f99f868835a727
  • Upwork Job ID: 1814779353535476997
  • Last Price Increase: 2024-07-23
  • Automatic offers:
    • Ahmed-Abdella | Contributor | 103224976
Issue OwnerCurrent Issue Owner: @RachCHopkins
github-actions[bot] commented 4 months ago

:wave: 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:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
melvin-bot[bot] commented 4 months ago

Triggered auto assignment to @carlosmiceli (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

lanitochka17 commented 4 months ago

We think that this bug might be related to #vip-vsp

mountiny commented 4 months ago

@mollfpr @b4s36t4 This one seems related to your PR https://github.com/Expensify/App/pull/44702 can you please confirm if revert fixes it?

mountiny commented 4 months ago

Not fixed by the revert, going to mark this as external

melvin-bot[bot] commented 4 months ago

Job added to Upwork: https://www.upwork.com/jobs/~0163f99f868835a727

melvin-bot[bot] commented 4 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External)

mountiny commented 4 months ago

In you proposals, you must include the offending PR. If you can highlight which PR caused it without a fix for the bug (the fix is a revert) a partial $50 reward will go your way

Ahmed-Abdella commented 4 months ago

@mountiny ther is no option to view the group image in the confirm page in production so it looks like this come from this PR #41586 that add a feature to view a group chat custom avatar.

Also I noticed a behaviour : If you wait for some time before viewing the image it works fine and display the image after the first refresh. Check the video below. ( but it doesn't work if you refresh it for one more time )

https://github.com/user-attachments/assets/2c8ee18a-2afb-402b-aa87-7a2497fc6388

So I think what happened is that: After refreshing the page the app trying trying to fetch the image from the backend, but it seems that it didn't get uploaded yet so the file is not found. When I try with a small size image and wait for sometime before veiwing the image it works because the image has been uploaded.

And here is the error message from the console.

The not found file message

Screenshot 2024-07-21 at 4 15 15 AM

Screenshot 2024-07-21 at 4 16 29 AM

Ahmed-Abdella commented 4 months ago

Not Completely sure, but I think the same PR also cause this issue #45842. I mentioned the PR there too.

gijoe0295 commented 4 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Avatar loads infinitely when refreshing full screen avatar on confirmation page

What is the root cause of that problem?

The image uploaded while creating group is optimistically saved locally in the form of blob URI. The blob data would be cleared once we refresh the page. As the result, console would throw ERR_FILE_NOT_FOUND and the attachment view modal would show loading:

https://github.com/Expensify/App/blob/5a2602c441170093e99850e2194808218b0aa838/src/components/ImageView/index.tsx#L240

and the group avatar in confirmation RHP would be reset to default.

Normally for an image to be uploaded to the CDN, we need to call the corresponding update avatar API and the BE will handle the upload. We haven't had any approaches solving the case of optimistic image data.

Offending PR: This has happened ever since we allowed viewing the custom avatar in full screen while creating group in https://github.com/Expensify/App/pull/41586.

What changes do you think we should make in order to solve the problem?

We should not allow View photo option if the image uri indicates a local file FileUtils.isLocalFile(url):

https://github.com/Expensify/App/blob/f3a8f736208166286e6f7da3562f1503d5ef2a3d/src/components/AvatarWithImagePicker.tsx#L337

Or we can revert the shouldDisableViewPhoto that had been removed in https://github.com/Expensify/App/pull/41586 and use in in NewChatConfirmationPage.

s77rt commented 4 months ago

cc @nexarvo Can you check this one ๐Ÿ‘€

NaveedShaikh78 commented 4 months ago

I saw this issue in Upwork. I tried the same step but now it is not reproducible, is it fix or still reproducible ?

melvin-bot[bot] commented 4 months ago

๐Ÿ“ฃ @NaveedShaikh78! ๐Ÿ“ฃ Hey, it seems we donโ€™t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
NaveedShaikh78 commented 4 months ago

Is it still reproducible?

tsa321 commented 4 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Avatar spinner shown when refreshing full screen avatar page and on new group chat confirmation page

What is the root cause of that problem?

PR https://github.com/Expensify/App/pull/41586 enables viewing group avatar in full screen. When user creates new group, the data is stored in onyx newChatDraft, but the avatar is stored as blob uri string. The blob uri string won't be available when the user refresh the app.

What changes do you think we should make in order to solve the problem?

We could store the avatar image as base64 string in onyx and use it in new/chat/confirm page. If we need to fix this issue quickly, I have made a draft PR.

mountiny commented 4 months ago

Good points, I think this is minor issue and @nexarvo @s77rt should be able to handle this as not a blocker

mountiny commented 4 months ago

We are proceeding with the revert here https://github.com/Expensify/App/pull/45863 so this will most likely be fixed after that

Ahmed-Abdella commented 4 months ago

In you proposals, you must include the offending PR. If you can highlight which PR caused it without a fix for the bug (the fix is a revert) a partial $50 reward will go your way

@mountiny Based on this, will I get paid for highlighting the PR?

melvin-bot[bot] commented 4 months ago

Upwork job price has been updated to $50

melvin-bot[bot] commented 4 months ago

Triggered auto assignment to @RachCHopkins (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] commented 4 months ago

๐Ÿ“ฃ @Ahmed-Abdella ๐ŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role ๐ŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review ๐Ÿง‘โ€๐Ÿ’ป Keep in mind: Code of Conduct | Contributing ๐Ÿ“–

mountiny commented 4 months ago

Yeah $50 to @Ahmed-Abdella

Ahmed-Abdella commented 4 months ago

Offer accepted, Thanks @mountiny

melvin-bot[bot] commented 4 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 4 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.11-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-08-01. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 4 months ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

s77rt commented 4 months ago

No checklist needed ^ Offending PR has been reverted

carlosmiceli commented 4 months ago

Can we close this?

s77rt commented 4 months ago

@carlosmiceli, @Ahmed-Abdella is due payment for finding offending PR

carlosmiceli commented 4 months ago

Understood!

melvin-bot[bot] commented 3 months ago

@carlosmiceli, @s77rt, @RachCHopkins, @mountiny, @Ahmed-Abdella Eep! 4 days overdue now. Issues have feelings too...

RachCHopkins commented 3 months ago

I'm here Melvin! Sorry, busy week last week!

mountiny commented 3 months ago

Summary $50 to @Ahmed-Abdella for help with this deploy blocker and finding the offending PR.

As we have reverted the offending change the checklist can be skipped

RachCHopkins commented 3 months ago

Payment Summary:

Contributor: @Ahmed-Abdella paid $50 via Upwork

RachCHopkins commented 3 months ago

Contributor has been paid, the contract has been completed, and the Upwork post has been closed.