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 2024-01-18] [$500] Private Note - The message 'Hmm... it's not here' displays instead of Skeleton UI when viewing Private Notes in Offline Mode. #30246

Closed
4 of 6 tasks
kbecciv opened this issue Oct 24, 2023 · 49 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 Oct 24, 2023

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: 1.3.90.1
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: @tranvantoan-qn
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697131558107909

Action Performed:

  1. Log in to any Account.
  2. Disable the network connection to switch to OFFLINE mode.
  3. Open any chat and select a Contact to view their details.
  4. Click on "Private Notes"
  5. Observation: You will see the message "Hmm... it's not here" displayed.

Expected Result:

A Skeleton UI should be displayed, as it is a general concept applied when the data is loading.

Actual Result:

Instead of a Skeleton UI, the message "Hmm... it's not here" is displayed.

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

Android: Native
Android: mWeb Chrome
Android.-.Chrome.4.mov
iOS: Native
Ios.-.Native.5.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS.-.Safari.4.mov
MacOS.-.Chrome.5.mp4
MacOS: Desktop
MacOS.-.Desktop.3.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cb01f2ab30a52085
  • Upwork Job ID: 1716795251231830016
  • Last Price Increase: 2023-11-07
  • Automatic offers:
    • jjcoffee | Reviewer | 27616931
    • hungvu193 | Contributor | 27616932
    • tranvantoan-qn | Reporter | 27616934
@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 Oct 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

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

@melvin-bot melvin-bot bot changed the title Private Note - The message 'Hmm... it's not here' displays instead of Skeleton UI when viewing Private Notes in Offline Mode. [$500] Private Note - The message 'Hmm... it's not here' displays instead of Skeleton UI when viewing Private Notes in Offline Mode. Oct 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

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

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

melvin-bot bot commented Oct 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

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

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

@rakshitjain13
Copy link
Contributor

rakshitjain13 commented Oct 24, 2023

Proposal

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

The message 'Hmm... it's not here' displays instead of Skeleton UI when viewing Private Notes in Offline Mode

What is the root cause of that problem?

In PrivateNotesListPage.js , should shouldShow become true due to offline mode

<FullPageNotFoundView
shouldShow={
_.isEmpty(report.reportID) ||
(!report.isLoadingPrivateNotes && network.isOffline && _.isEmpty(lodashGet(report, 'privateNotes', {}))) ||
ReportUtils.isArchivedRoom(report)
}
>

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

We have to update the condition with !network.isOffline in the above check and show OptionsListSkeletonView when the network is offline and loading

<FullPageNotFoundView
                shouldShow={
                    _.isEmpty(report.reportID) ||
                    (!report.isLoadingPrivateNotes && _.isEmpty(lodashGet(report, 'privateNotes', {})) && !network.isOffline) ||
                    ReportUtils.isArchivedRoom(report)
                }
            >
                <HeaderWithBackButton
                    title={translate('privateNotes.title')}
                    shouldShowBackButton
                    onCloseButtonPress={() => Navigation.dismissModal()}
                />
                <ScrollView contentContainerStyle={styles.flexGrow1}>
                    {(( network.isOffline && _.isEmpty(lodashGet(report, 'privateNotes', {})))|| (report.isLoadingPrivateNotes && _.isEmpty(lodashGet(report, 'privateNotes', {})))) ? (
                          <FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
                    ) : (
                        _.map(privateNotes, (item, index) => getMenuItem(item, index))
                    )}
                </ScrollView>
            </FullPageNotFoundView>
Screen.Recording.2023-10-24.at.6.48.57.PM.mov

What alternative solutions did you explore? (Optional)

NA

@jjcoffee
Copy link
Contributor

@rakshitjain13 Thanks for the proposal! If we go ahead with this change, I think we'd probably want to always display the skeleton loader instead of the full screen loader otherwise coming back online there'd be an odd transition from Skeleton Loader -> Full Screen Loader -> Notes. cc @Expensify/design for feedback!

@rakshitjain13
Copy link
Contributor

@jjcoffee Thanks for the feedback and I think your suggestion makes more sense. Hence updated the proposal #30246 (comment)

@hungvu193
Copy link
Contributor

hungvu193 commented Oct 25, 2023

Proposal

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

The message 'Hmm... it's not here' displays instead of Skeleton UI when viewing Private Notes in Offline Mode.

What is the root cause of that problem?

We currently show NotfoundPage with below condition

shouldShow={
_.isEmpty(report.reportID) ||
(!report.isLoadingPrivateNotes && network.isOffline && _.isEmpty(lodashGet(report, 'privateNotes', {}))) ||
ReportUtils.isArchivedRoom(report)
}

Since we only load when it's not offline, NotFoundPage will be shown in this case.

if (network.isOffline && report.isLoadingPrivateNotes) {
return;
}
Report.getReportPrivateNote(report.reportID);

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

Create a variable call isReconnecting:

    const prevIsOffline = usePrevious(network.isOffline);
    const isReconnecting =  prevIsOffline && !network.isOffline;

Show the loading indicator or skeleton instead of blocking user from using it (similar to other places like Address or WorkspaceMembers). So we need to update shouldShow props of FullPageNotFoundView. Also update the condition of

 shouldShow={
                    _.isEmpty(report.reportID) ||
                    (!report.isLoadingPrivateNotes && !network.isOffline && !isReconnecting && _.isEmpty(lodashGet(report, 'privateNotes', {}))) ||
                    ReportUtils.isArchivedRoom(report)
                }
 {(report.isLoadingPrivateNotes && _.isEmpty(privateNotes) || ((network.isOffline || isReconnecting) && _.isEmpty(privateNotes))) ? (
                        <FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
                    ) : (
                        _.map(privateNotes, (item, index) => getMenuItem(item, index))
                    )}

What alternative solutions did you explore? (Optional)

Similar above but we will add a new variable called isLoadingPrivateNote and default to true.

const isLoadingPrivateNotes = lodashGet(report, 'isLoadingPrivateNotes', true);

After that replace the report.isLoadingPrivateNotes with isLoadingPrivateNotes

@tranvantoan-qn
Copy link

tranvantoan-qn commented Oct 25, 2023

@jjcoffee

FYI: This issue was expected to be resolved by #27591, but for some reason, it hasn't been (that's why this issue was created).

Therefore, I believe it's necessary to examine that issue for further details on what was actually implemented and whether we can build upon that solution.

@jjcoffee
Copy link
Contributor

@tranvantoan-qn Thanks for the extra context! Looking at that issue it looks like it's expected for the FullScreenLoadingIndicator to show and not the skeleton loader. We also want to make sure that the notes page will load if we already have the notes loaded (as you suggested in your comment). cc @hungvu193 and @rakshitjain13

@rakshitjain13
Copy link
Contributor

@jjcoffee Thanks for the confirmation that FullScreenLoadingIndicator is expected and not Skeleton which the bug reporter proposed. Hence I am updating my proposal to shift from OptionsListSkeletonView to FullScreenLoadingIndicator

@hungvu193
Copy link
Contributor

hungvu193 commented Oct 25, 2023

@tranvantoan-qn Thanks for the extra context! Looking at that issue it looks like it's expected for the FullScreenLoadingIndicator to show and not the skeleton loader. We also want to make sure that the notes page will load if we already have the notes loaded (as you suggested in your comment). cc @hungvu193 and @rakshitjain13

Yeah, we're showing Fullscreenloading in other pages until we reconnect to the internet as I said in my proposal.

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

melvin-bot bot commented Oct 30, 2023

@puneetlath, @jjcoffee Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Oct 31, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@puneetlath
Copy link
Contributor

@jjcoffee mind summarizing where we're at with this issue currently?

@melvin-bot melvin-bot bot removed the Overdue label Oct 31, 2023
@jjcoffee
Copy link
Contributor

jjcoffee commented Nov 1, 2023

So we have two pretty identical proposals, but @hungvu193's was the first to include handling for being offline and already having loaded the notes.

When testing both proposals I see a brief appearance of the Hmm... it's not here message before the private notes load after coming back online:

private-notes-coming-online-2023-11-01_17.02.21.mp4

@rakshitjain13
Copy link
Contributor

@jjcoffee I think it is because when we shift from offline to online for a moment isLoadingPrivateNotes is false. After all, it is set to false in a case when you first visited or failed due to offline

App/src/libs/actions/Report.js

Lines 2377 to 2385 in f9d11c5

failureData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
isLoadingPrivateNotes: false,
},
},
],

which makes the below condition true in shouldShow

  (!report.isLoadingPrivateNotes && _.isEmpty(lodashGet(report, 'privateNotes', {})) && !network.isOffline)

If we change to true in failureData we don't Hmm... it's not here when shifting from offline to online like

failureData: [
                {
                    onyxMethod: Onyx.METHOD.MERGE,
                    key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
                    value: {
                        isLoadingPrivateNotes: true,
                    },
                },
            ]

cc: @hungvu193

@hungvu193
Copy link
Contributor

hungvu193 commented Nov 2, 2023

So we have two pretty identical proposals, but @hungvu193's was the first to include handling for being offline and already having loaded the notes.

When testing both proposals I see a brief appearance of the Hmm... it's not here message before the private notes load after coming back online:

private-notes-coming-online-2023-11-01_17.02.21.mp4

So the Report.getReportPrivateNote(report.reportID); is using API.read which is not persisted. Because of that after changing connection to online, NotFoundView will be shown first because our useEffect (which includes the Report.getReportPrivateNote(report.reportID) to set isLoadingPrivateNotes to true will run after re-render).
I think the best way to archive the expected result is to introduce new variable called isReconnecting and we won't show NotFoundView when our application is reconnecting. More details in my updated proposal

Another solution, change the API.read to API.write, this will make our request is persisted and we can call Report.getReportPrivateNote(report.reportID); even when offline, I tested and it worked, however I'm not sure if we can do that.

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

melvin-bot bot commented Nov 7, 2023

@puneetlath @jjcoffee this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Nov 7, 2023

@puneetlath, @jjcoffee Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Monthly KSv2 label Jan 1, 2024
Copy link

melvin-bot bot commented Jan 1, 2024

This issue has not been updated in over 15 days. @puneetlath, @hungvu193, @jjcoffee eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@jjcoffee
Copy link
Contributor

jjcoffee commented Jan 2, 2024

Just waiting for @puneetlath to merge the PR.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Jan 11, 2024
@melvin-bot melvin-bot bot changed the title [$500] Private Note - The message 'Hmm... it's not here' displays instead of Skeleton UI when viewing Private Notes in Offline Mode. [HOLD for payment 2024-01-18] [$500] Private Note - The message 'Hmm... it's not here' displays instead of Skeleton UI when viewing Private Notes in Offline Mode. Jan 11, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 11, 2024
Copy link

melvin-bot bot commented Jan 11, 2024

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

Copy link

melvin-bot bot commented Jan 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.24-3 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 2024-01-18. 🎊

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

Copy link

melvin-bot bot commented Jan 11, 2024

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:

  • [@jjcoffee] The PR that introduced the bug has been identified. Link to the PR:
  • [@jjcoffee] 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:
  • [@jjcoffee] 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:
  • [@jjcoffee] Determine if we should create a regression test for this bug.
  • [@jjcoffee] 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.
  • [@puneetlath] 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 Jan 17, 2024
@puneetlath
Copy link
Contributor

@jjcoffee bump on the checklist so that we can pay tomorrow.

@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Fix: Private notes page shows not found in offline mode #28461
  • 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: https://github.com/Expensify/App/pull/28461/files#r1457057393
  • 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: N/A - just needed more thorough testing
  • Determine if we should create a regression test for this bug. Yes
  • 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.

Regression Test Proposal

  1. Open the app and go offline
  2. Open any chat which has private notes and tap on the header to open the chat details
  3. Tap on "Private Notes"
  4. Verify that a loader displays
  5. Go back online
  6. Verify that the notes are populated

Do we agree 👍 or 👎

@jjcoffee
Copy link
Contributor

Note that there's an outstanding regression that is waiting on @hungvu193's input.

@puneetlath
Copy link
Contributor

@hungvu193 are you planning to handle that shortly? We won't be able to pay this one out until you do.

@hungvu193
Copy link
Contributor

@hungvu193 are you planning to handle that shortly? We won't be able to pay this one out until you do.

Cool. I'm on it.

@melvin-bot melvin-bot bot added the Overdue label Jan 24, 2024
Copy link

melvin-bot bot commented Jan 30, 2024

@puneetlath, @hungvu193, @jjcoffee Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

@jjcoffee
Copy link
Contributor

The PR that fixes the regression is merged by the way (not hit production yet).

@melvin-bot melvin-bot bot removed the Overdue label Jan 30, 2024
@jjcoffee
Copy link
Contributor

Deployed to production! @puneetlath Can we update the HOLD for payment here to 2024-02-07? Thanks!

@melvin-bot melvin-bot bot added the Overdue label Feb 2, 2024
Copy link

melvin-bot bot commented Feb 5, 2024

@puneetlath, @hungvu193, @jjcoffee Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Feb 7, 2024

@puneetlath, @hungvu193, @jjcoffee 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@puneetlath
Copy link
Contributor

All paid. Thanks everyone!

@melvin-bot melvin-bot bot removed the Overdue label Feb 7, 2024
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