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

[HOLD for payment 2023-12-20] [$500] iOS - LHN - Conversation disappears from LHN when creating an IOU with a new user in offline mode #31822

Closed
1 of 6 tasks
kbecciv opened this issue Nov 24, 2023 · 24 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Nov 24, 2023

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: 1.4.3.0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open New Expensify app
  2. Log in to your HT account
  3. Going to offline mode
  4. Complete the IOU with a new user
  5. Navigate to LHN

Expected Result:

The conversation should not disappear from the LHN when creating an IOU with a new user offline

Actual Result:

Conversation disappears from LHN when creating an IOU with a new user in offline mode

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6289490_1700829488860.Prod.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019835c6161c3d6b2f
  • Upwork Job ID: 1728035316795932672
  • Last Price Increase: 2023-11-24
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 24, 2023
@melvin-bot melvin-bot bot changed the title iOS - LHN - Conversation disappears from LHN when creating an IOU with a new user in offline mode [$500] iOS - LHN - Conversation disappears from LHN when creating an IOU with a new user in offline mode Nov 24, 2023
Copy link

melvin-bot bot commented Nov 24, 2023

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

Copy link

melvin-bot bot commented Nov 24, 2023

Triggered auto assignment to @miljakljajic (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 24, 2023
Copy link

melvin-bot bot commented Nov 24, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Nov 24, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Nov 27, 2023
Copy link

melvin-bot bot commented Nov 27, 2023

@narefyev91, @miljakljajic Whoops! This issue is 2 days overdue. Let's get this updated quick!

@narefyev91
Copy link
Contributor

Waiting for proposals

@melvin-bot melvin-bot bot removed the Overdue label Nov 28, 2023
@keisyrzk
Copy link
Contributor

Tried multiple times and cannot see/reproduce the described problem.

Copy link

melvin-bot bot commented Nov 28, 2023

📣 @keisyrzk! 📣
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>

@talhajavedmukhtar
Copy link
Contributor

Proposal

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

When in offline mode, new IOU's do not appear in the LHN area until the network connectivity is restored.

What is the root cause of that problem?

The problem lies in this section of SidebarLinksData:

https://github.com/Expensify/App/blob/a0b219711080751d6826bb2330ddd85c1641d7bf/src/pages/home/sidebar/SidebarLinksData.js#L70C1-L83

As a resolution in in PR #24596, the optionListItems are restricted to update only once the report data is completely loaded. However, if the user goes offline at any point when the report data is loading, isLoadingReportData never gets a chance to resolve to "false". It remains stuck as "true".

This means that in this line below, isLoading always resolves to true (save when the user's auth session expires) until the WiFi is connected again:

const isLoading = SessionUtils.didUserLogInDuringSession() && isLoadingReportData;

Which means that based on the lines below, the new optionsListItems are blocked from populating:

if (!isLoading || !reportIDsRef.current) {
    reportIDsRef.current = reportIDs;
}

This is the source of the problem.

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

The simplest solution is to have SidebarLinksData have the network.isOffline prop like some other components do. And update the code area referenced above to something like:

if (!isLoading || !reportIDsRef.current || props.network.isOffline) {
    reportIDsRef.current = reportIDs;
}

This will ensure that the new optionsListItems are shown even when isLoading is stuck as "true". Additionally, it won't have the risk of the lots-of-reRendering issue from PR #24596 since isLoading should technically remain stuck while network.isOffline.

What alternative solutions did you explore? (Optional)

Another solution is to update isLoadingReportData appropriately but handling its state based on a wifi connection is significantly more complex than the solution above.

@melvin-bot melvin-bot bot added the Overdue label Dec 1, 2023
@narefyev91
Copy link
Contributor

Proposal from @talhajavedmukhtar looks good to me #31822 (comment)
I think that we should also track when user may fall in offline mode and should not block populating optionsListItems
🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 1, 2023

Triggered auto assignment to @arosiclair, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 1, 2023
Copy link

melvin-bot bot commented Dec 1, 2023

📣 @talhajavedmukhtar You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@talhajavedmukhtar
Copy link
Contributor

talhajavedmukhtar commented Dec 2, 2023

I will create the PR latest by 11:59 PM PST on 6th December.

@narefyev91 Just to confirm, you mean that we should instantly update the optionsListItems as soon as the user goes offline, instead of waiting for the next call of the current version of the useMemo hook, right? (Can simply be handled by adding the isOffline variable to useMemo’s dependency array)

@narefyev91
Copy link
Contributor

I will create the PR latest by 11:59 PM PST on 5th December.

@narefyev91 Just to confirm, you mean that we should instantly update the optionsListItems as soon as the user goes offline, instead of waiting for the next call of the current version of the useMemo hook, right? (Can simply be handled by adding the isOffline variable to useMemo’s dependency array)

Yup - we need to use isOffline prop in useMemo

@melvin-bot melvin-bot bot added the Overdue label Dec 4, 2023
@miljakljajic
Copy link
Contributor

Contract extended to @talhajavedmukhtar !

@narefyev91 could you apply to the upwork job?

@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2023
@narefyev91
Copy link
Contributor

Contract extended to @talhajavedmukhtar !

@narefyev91 could you apply to the upwork job?

Hey @miljakljajic i'm from expert agency - Callstack - no needs anything from upwork 👍

@narefyev91
Copy link
Contributor

Hey @talhajavedmukhtar any updates on the PR?

@talhajavedmukhtar
Copy link
Contributor

talhajavedmukhtar commented Dec 6, 2023

@narefyev91 I have been stuck trying to build the native android version of the app…

Bug is resolved on the other platforms; just need to test it on Android too before creating the PR.

It will be at max 17 more hours (11:59 PM PST 6th December) till I create the PR.

@narefyev91
Copy link
Contributor

@narefyev91 I have been stuck trying to build the native android version of the app…

Bug is resolved on the other platforms; just need to test it on Android too before creating the PR.

Sorry for not sharing an update at the time of my proposed deadline. I made a typo; I had meant 6th December and had that time logged elsewhere.

It will be at max 17 more hours (11:59 PM PST 6th December) till I create the PR.

Cool - appreciated !

@talhajavedmukhtar
Copy link
Contributor

@narefyev91 finally managed to build and test the native android version. Compiling all the recordings now for the PR. Will create the PR any minute now.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 7, 2023
arosiclair added a commit that referenced this issue Dec 8, 2023
[Bug resolution] for [#31822: Conversation disappears from LHN when creating an IOU with a new user in offline mode]
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 13, 2023
@melvin-bot melvin-bot bot changed the title [$500] iOS - LHN - Conversation disappears from LHN when creating an IOU with a new user in offline mode [HOLD for payment 2023-12-20] [$500] iOS - LHN - Conversation disappears from LHN when creating an IOU with a new user in offline mode Dec 13, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

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

Copy link

melvin-bot bot commented Dec 13, 2023

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

If no regressions arise, payment will be issued on 2023-12-20. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Dec 13, 2023

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:

  • [@narefyev91] The PR that introduced the bug has been identified. Link to the PR:
  • [@narefyev91] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@narefyev91] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@narefyev91] Determine if we should create a regression test for this bug.
  • [@narefyev91] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@miljakljajic] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 19, 2023
@miljakljajic
Copy link
Contributor

Payment summary for @talhajavedmukhtar:

500 USD for C+ role in reviewing prosposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants