Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$125] LHN-Chat with a draft returns to the bottom of LHN after going online and refreshing the app #55254

Open
2 of 8 tasks
mitarachim opened this issue Jan 15, 2025 · 20 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@mitarachim
Copy link

mitarachim commented Jan 15, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.85-4
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/cases/view/2644118
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: iPhone 13 Pro Max iOS 18.1.1
App Component: Left Hand Navigation (LHN)

Action Performed:

  1. Open staging ND Hybrid app and log in as gmail user
  2. Disconnect the internet on the device
  3. Go to the conversation that is not at the top of LHN
  4. Start typing in the composer, but do not send the message
  5. Navigate to LHN and make sure the chat with the draft is moved to the top
  6. Enable the internet connection and observe the LHN - drafted chat is at the top
  7. Refresh the app and observe the LHN

Expected Result:

The chat with the draft remains at the top of LHN (following other chats with higher priority)

Actual Result:

Chat with a draft returns to the bottom of LHN (it's original place) after going online and refreshing the app

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6714365_1736898636530.ScreenRecording_01-14-2025_15-20-59_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021879519969934388594
  • Upwork Job ID: 1879519969934388594
  • Last Price Increase: 2025-01-15
Issue OwnerCurrent Issue Owner: @allroundexperts
@mitarachim mitarachim added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlockerCash This issue or pull request should block deployment labels Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

Copy link

melvin-bot bot commented Jan 15, 2025

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

Copy link

melvin-bot bot commented Jan 15, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jan 15, 2025
Copy link
Contributor

👋 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.

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jan 15, 2025
@melvin-bot melvin-bot bot changed the title LHN-Chat with a draft returns to the bottom of LHN after going online and refreshing the app [$250] LHN-Chat with a draft returns to the bottom of LHN after going online and refreshing the app Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jan 15, 2025
@mountiny mountiny changed the title [$250] LHN-Chat with a draft returns to the bottom of LHN after going online and refreshing the app [$125] LHN-Chat with a draft returns to the bottom of LHN after going online and refreshing the app Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

Upwork job price has been updated to $125

@mountiny
Copy link
Contributor

Looking for proposals that identify the offending PR too

I am demoting as I cannot reproduce with focus mode, additionally going to the offline state is edge case and the user is not blocked from the action so I dont think we have to block it

@nkdengineer
Copy link
Contributor

@mountiny I can reproduce this every time I reload the App, not only go offline.

@mountiny
Copy link
Contributor

In the most recent mode only right? cc @TMisiukiewicz this is probably related to the onyx change

@nkdengineer
Copy link
Contributor

In the most recent mode only right? cc @TMisiukiewicz this is probably related to the onyx change

@mountiny Yes in most recent mode. In focus mode, the draft report is hidden when we reload the app, the RCA is also what we discussed in Slack.

@mountiny
Copy link
Contributor

the draft report is hidden when we reload the app, the RCA is also what we discussed in Slack.

In my testing, I could see the draft after reopning the app

@nkdengineer
Copy link
Contributor

It doesn't appear from my testing.

Screen.Recording.2025-01-15.at.22.27.29.mov

@mountiny
Copy link
Contributor

@gedu is looking into this btw

@gedu
Copy link
Contributor

gedu commented Jan 15, 2025

I could reproduce it on Android, so I will dig deeper

@arosiclair
Copy link
Contributor

Looks like you got a handle on this @mountiny so I'll assign you

@arosiclair arosiclair assigned mountiny and unassigned arosiclair Jan 15, 2025
@gedu
Copy link
Contributor

gedu commented Jan 16, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-01-16 17:46:26 UTC.

Proposal

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

Chat with a draft returns to the bottom of LHN (it's original place) after going online and refreshing the app

What is the root cause of that problem?

When the app loads, the ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT hook in useReportIDs loads the cache value before the Onyx.connect set the collection value draftCommentCollection, which causes the UI to render with incorrect draft positions

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

Will modify the useReportIDs file, to set an initial value in the hook, making useOnyx send that first, waiting for the broadcasting of the actual value in Onyx, which is send to Onyx.connect and Hooks (useOnyx).
The new value produce the hooks gets updated, producing a new rerender and placing the drafts into the right position.

const [reportsDrafts] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {initialValue: {}});

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

@mountiny

Copy link
Contributor

⚠️ @gedu Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 16, 2025
@mountiny
Copy link
Contributor

@gedu please feel free to raise the PR

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 17, 2025
@gedu
Copy link
Contributor

gedu commented Jan 17, 2025

PR created: #55411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants