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-10-13] [HOLD for payment 2023-10-12] [$500] Dev: Web - Hmm it's not there message appears if open private notes in offline mode #27591

Closed
1 of 6 tasks
kbecciv opened this issue Sep 16, 2023 · 48 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Sep 16, 2023

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


Action Performed:

  1. Create workspace
  2. Go offline
  3. Go to #admins
  4. Click on header
  5. Go to Private notes

Expected Result:

It should show private notes

Actual Result:

hmm it's not there message appear

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: Dev 1.3.70.5
Reproducible in staging?: no
Reproducible in production?: no
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
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-09-15.at.6.55.49.PM.mov

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694784369659399

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0114cd1c2b0e08bcd2
  • Upwork Job ID: 1703114589030166528
  • Last Price Increase: 2023-09-16
  • Automatic offers:
    • ahmedGaber93 | Contributor | 26937500
    • gadhiyamanan | Reporter | 26937502
    • tienifr | Contributor | 26938659
@ahmedGaber93
Copy link
Contributor

Proposal

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

hmm it's not there message appears if open private notes in offline mode

What is the root cause of that problem?

the FullPageNotFoundView shouldShow has (!report.isLoadingPrivateNotes && network.isOffline && _.isEmpty(lodashGet(report, 'privateNotes', {}))) which make it true when offline and page not loaded before

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

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

In this case, We can show offline view instead of not fount

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


<FullPageNotFoundView
    shouldShow={_.isEmpty(report.reportID) || isOfflineAndEmpty}
    icon={isOfflineAndEmpty ? Expensicons.OfflineCloud : undefined}
    titleKey={isOfflineAndEmpty ? "common.youAppearToBeOffline" : undefined}
    subtitleKey={isOfflineAndEmpty ? "common.thisFeatureRequiresInternet" : undefined}
    onBackButtonPress={() => Navigation.goBack()}
>

we need to add prop icon to FullPageNotFoundView to control it by prop

also we can remove subtitle or use other subtitle words

What alternative solutions did you explore? (Optional)

we can instead remove network.isOffline && and keep page in loading

@kbecciv kbecciv added the External Added to denote the issue can be worked on by a contributor label Sep 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 16, 2023

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

@melvin-bot melvin-bot bot changed the title Dev: Web - Hmm it's not there message appears if open private notes in offline mode [$500] Dev: Web - Hmm it's not there message appears if open private notes in offline mode Sep 16, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 16, 2023

Triggered auto assignment to @NicMendonca (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 16, 2023

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

@narefyev91
Copy link
Contributor

narefyev91 commented Sep 18, 2023

After clarification Proposal from @tienifr looks good to me #27591 (comment)
🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Sep 18, 2023

Proposal

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

Dev: Web - Hmm it's not there message appears if open private notes in offline mode

What is the root cause of that problem?

After creating the WS, we don't fetch the private note data. So when users go offline and visit private note page, we don't allow the API call -> it's empty and isLoadingPrivateNotes is false -> we show the not found page

useEffect(() => {
if (network.isOffline) {
return;
}
Report.getReportPrivateNote(report.reportID);
}, [report.reportID, network.isOffline]);

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

We should not prevent API call when network is offline as what we did with other read APIs. When users go to privateNote page, isLoadingPrivateNotes should be true no matter the network is

change this line

if (network.isOffline) {

to

        if(network.isOffline && report.isLoadingPrivateNotes){

@tienifr
Copy link
Contributor

tienifr commented Sep 18, 2023

@narefyev91 Sorry for the delay proposal. I see other places that use API.read(), we should not prevent API call when users go offline (that cause this bug). So for consistency, we should add other condition report.isLoadingPrivateNotes to prevent API call here. What do you think

@narefyev91
Copy link
Contributor

@tienifr based on your changes - what user will see - loading screen?

@tienifr
Copy link
Contributor

tienifr commented Sep 18, 2023

Yes, I think it's better than offline view. Here's the demo @narefyev91

Screen.Recording.2023-09-18.at.15.51.46.mov

@ahmedGaber93
Copy link
Contributor

I think there is no prevent API call here. because useEffect deps hase network.isOffline and when user back online this dependency will change, and the api will call

useEffect(() => {
if (network.isOffline) {
return;
}
Report.getReportPrivateNote(report.reportID);
}, [report.reportID, network.isOffline]);

@tienifr
Copy link
Contributor

tienifr commented Sep 18, 2023

we should not prevent API call when users go offline

@ahmedGaber93 I mean when users go offline.

@narefyev91
Copy link
Contributor

Yup i think we need here correct behaviour - in case in expected results we not see a clear picture.
We have 2 cases here - either we show offline screen - with suggestion to go online or we show loaded - until user will not get back to online
First case - proposal from @ahmedGaber93
Second case proposal from @tienifr
We will need your help @grgia

@tienifr
Copy link
Contributor

tienifr commented Sep 20, 2023

@grgia What do you think about this?

@narefyev91
Copy link
Contributor

Friendly bump - @grgia

@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2023
@grgia
Copy link
Contributor

grgia commented Sep 25, 2023

@narefyev91 could you explain what you mean by "offline screen" with a screenshot

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2023
@narefyev91
Copy link
Contributor

@grgia
Screenshot 2023-09-25 at 11 20 41

@grgia
Copy link
Contributor

grgia commented Sep 25, 2023

I prefer the offline page pattern @narefyev91, could you remind me which proposal that was?

@narefyev91
Copy link
Contributor

@tienifr
Copy link
Contributor

tienifr commented Sep 26, 2023

@grgia @narefyev91 I don't think the offline page is the good idea. The offline page should be shown for the page that really need the network (bank account). In this page, when we already loaded the data before (it was in Onyx) we can still use this page. Beside, in our App when calling API.read, we just need to update isLoading to false no matter the network is

@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Sep 26, 2023

I think it is a normal and expected behavior to displaying offline page when user offline and no onxy data yet

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 5, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.77-7 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-10-12. 🎊

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 6, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-12] [$500] Dev: Web - Hmm it's not there message appears if open private notes in offline mode [HOLD for payment 2023-10-13] [HOLD for payment 2023-10-12] [$500] Dev: Web - Hmm it's not there message appears if open private notes in offline mode Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.78-4 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-10-13. 🎊

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 11, 2023
@kbecciv
Copy link
Author

kbecciv commented Oct 12, 2023

@narefyev91 @NicMendonca
Issue is not fixed on build 1.3.83.1

Recording.4978.mp4

@tranvantoan-qn
Copy link

tranvantoan-qn commented Oct 13, 2023

This doesn't seem fixed yet (we have missed the self-test and regression test), or there's a similar case as the one I reported here. - https://expensify.slack.com/archives/C049HHMV9SM/p1697131558107909

Furthermore, with this solution, consider the following scenario:

  • User is in online mode.
  • User views A's private notes.
  • User goes offline.
  • User navigates to somewhere else in the app in offline mode.
  • User goes back to A's private notes.

Question: Will the private notes still display, or will the offline page display? We need to make sure that the private notes are still showing.

(IMO, showing Skeleton UI can be a better option)

@melvin-bot melvin-bot bot added the Overdue label Oct 13, 2023
@NicMendonca
Copy link
Contributor

@grgia what do you think? ^

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 13, 2023
@grgia
Copy link
Contributor

grgia commented Oct 16, 2023

@tranvantoan-qn

Yes, if the data is loaded, we should show it.

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@tranvantoan-qn
Copy link

tranvantoan-qn commented Oct 16, 2023

@grgia So we need to confirm that the original proposal is already merged and then check the case I mentioned above

@melvin-bot melvin-bot bot added the Overdue label Oct 19, 2023
@grgia
Copy link
Contributor

grgia commented Oct 19, 2023

@narefyev91 could you take a look at the progression of this issue?

@melvin-bot melvin-bot bot removed the Overdue label Oct 19, 2023
@narefyev91
Copy link
Contributor

narefyev91 commented Oct 19, 2023

@tienifr can you please take a look at the latest comments - seems after we get on Private Notes - and after some times spinner is moving away and we still see "Hmmm is not here page"
reference #27591 (comment)

@tienifr
Copy link
Contributor

tienifr commented Oct 19, 2023

@grgia @narefyev91 After investigating the RCA, I found out that the PR cause the regressions. Before that PR, the failure API will not update the failureData. After it's merged, the failure data of API GetReportPrivateNote update isLoadingPrivateNotes to false -> That causes the problem

isLoadingPrivateNotes: false,

@tienifr
Copy link
Contributor

tienifr commented Oct 19, 2023

I don't think we should handle this one as the regression

@NicMendonca
Copy link
Contributor

reporter: @gadhiyamanan - you've been paid!
contributor: @tienifr - you've been paid!

@tienifr do we need to keep this open for any reason?

@melvin-bot melvin-bot bot added the Overdue label Oct 23, 2023
@grgia
Copy link
Contributor

grgia commented Oct 24, 2023

closing

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 Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants