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.57k stars 2.91k forks source link

Profile- Copilot Avatar Not Updated After Adding Offline and Coming Online #52905

Open IuliiaHerets opened 16 hours ago

IuliiaHerets commented 16 hours 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: v9.0.65-1 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+tw7377377373733@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to Settings > Security.
  2. Go offline and add a Copilot by entering an email.
  3. Select an Access Level and come back online.
  4. Add the Copilot while online.
  5. Observe that the Copilot avatar is not updated.

Expected Result:

The Copilot avatar should update immediately after adding the Copilot offline and coming online.

Actual Result:

The Copilot avatar remains unchanged after adding the Copilot offline and then going online.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/326409df-3dce-4fcb-b061-fb94bf5d82e6

View all open jobs on GitHub

melvin-bot[bot] commented 16 hours ago

Triggered auto assignment to @CortneyOfstad (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.

cretadn22 commented 15 hours ago

Proposal

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

Copilot Avatar Not Updated After Adding Offline and Coming Online

What is the root cause of that problem?

https://github.com/Expensify/App/blob/4c44827398f884af626872c33f64dd358d19eff4/src/libs/actions/Report.ts#L4009-L4012

When searching for users offline, the SearchForReports API is not called. As a result, we cannot retrieve the personalDetail of these users, causing the name and avatar to always display their default values.

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

When a user is selected here, we need to check if their personalDetail has not been retrieved or if the user is offline. In such cases, we will save the email of the selected user to a new field in Onyx (could be personalDetailNeedToFetch)

Later, in the reconnectApp function, we will use the personalDetailNeedToFetch field to fetch the necessary personalDetail data (can be use SearchForReports API or another API)

What alternative solutions did you explore? (Optional)