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.56k stars 2.9k forks source link

[$250] Task - Task name not updated in chat when it got changed offline #50209

Closed IuliiaHerets closed 1 month ago

IuliiaHerets commented 1 month 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.44.8 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5042712 Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Open any chat
  3. Click on "+" > Assign task
  4. Add the the task name and create a task
  5. Disable internet connection
  6. Change the task name to something else
  7. Return to the chat if needed

Expected Result:

The updated task name is displayed in the chat

Actual Result:

The old task name is still displayed in the chat

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/0621573e-d109-4dd1-86d4-4cf23eaa7fa2

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021842218862975991434
  • Upwork Job ID: 1842218862975991434
  • Last Price Increase: 2024-10-04
Issue OwnerCurrent Issue Owner: @ishpaul777
melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

github-actions[bot] commented 1 month 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.
mkzie2 commented 1 month ago

Edited by proposal-police: This proposal was edited at 2024-10-04 09:12:30 UTC.

Proposal

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

The old task name is still displayed in the chat when updating task name offline

What is the root cause of that problem?

There have been an unsynchronization issue between Onyx data subscribed in component via useOnyx and the data in utils file:

https://github.com/Expensify/App/blob/92eee5f433c15203e37cf5c87ea57fd9a1664b3e/src/components/ReportActionItem/TaskPreview.tsx#L76

https://github.com/Expensify/App/blob/9b7af888d3e6ff12ee1e043a69932de9aad3ddd7/src/libs/TaskUtils.ts#L41

Causing the utils file data to be stale (not updated).

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

There have been many issues like https://github.com/Expensify/App/issues/49551 to remove usages of using Onyx.connect in utils files, we should pass Onyx data directly from component instead and let these utils file only handle its utility.

So in this case, update getTaskTitle to receive taskReport directly instead of taskReportID and pass it from TaskPreview.

There are 2 usages of getTaskTitle, we need to update them accordingly.

What alternative solutions did you explore (Optional)?

We can update the task's parent report action's childReportName optimistically when editing task title:

https://github.com/Expensify/App/blob/52aa9a953167814edab2b49fda9ed5df51200d40/src/libs/actions/Task.ts#L497

because it's used as a fallback task title:

https://github.com/Expensify/App/blob/92eee5f433c15203e37cf5c87ea57fd9a1664b3e/src/components/ReportActionItem/TaskPreview.tsx#L76

mkzie2 commented 1 month ago

Update proposal

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

flodnv commented 1 month ago

@mkzie2 any idea which PR caused this regression?

@ishpaul777 what are your thoughts on the proposal?

ishpaul777 commented 1 month ago

looking 👀

ishpaul777 commented 1 month ago

@mkzie2's Proposal makes sense and seems to be working, but we should know the offending PR before moving forward with a fix and assigning a contributor

mkzie2 commented 1 month ago

I tried reverting PR https://github.com/Expensify/App/pull/49686, specifically this change and it fixed the issue though I haven't understood why.

ishpaul777 commented 1 month ago

reverting here to confirm if its the offending PR

ishpaul777 commented 1 month ago

Confirmed that reverting it fixes the issue

https://github.com/user-attachments/assets/ffd4b01d-7389-42f4-a9b6-f40ee597aba8

ishpaul777 commented 1 month ago

Since we can't understand why the PR causes the issue, instead of rushing a fix i think we should revert to unblock the deploy and let orignal author take care of this in a second try. Any thoughts @flodnv @jasperhuangg ??


The given solution works in my testing and i dont think there will be any side effects, its just that proposal does not provide enough Root cause Analysis

jasperhuangg commented 1 month ago

@ishpaul777 I'm happy with that, thanks a lot for investigating the revert.

isagoico commented 1 month ago

Unable to reproduce this issue on build v9.0.44-10. Task name got updated while offline and the changes were still displayed after going back online. image

jasperhuangg commented 1 month ago

@dylanexpensify @ishpaul777 is owed $250 for this issue, no other payments required

rayane-djouah commented 1 month ago

RCA: https://github.com/Expensify/App/issues/49086#issuecomment-2395057167

dylanexpensify commented 1 month ago

Payment summary:

Contributor+: @ishpaul777 $250 via Upwork

Please apply/request!

dylanexpensify commented 1 month ago

@ishpaul777 apply here! 🙇‍♂️

ishpaul777 commented 1 month ago

@dylanexpensify Please send in invite 🙇

dylanexpensify commented 1 month ago

@ishpaul777 done!

ishpaul777 commented 1 month ago

accepted invite

melvin-bot[bot] commented 1 month ago

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

dylanexpensify commented 1 month ago

Ah ignore @adelekennedy I'll finish payment - @ishpaul777 sent offer!

dylanexpensify commented 1 month ago

this is done btw!