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-06-13] MEDIUM: [$250] Add logging around offline state to help diagnose bugs #40250

Closed
1 of 6 tasks
m-natarajan opened this issue Apr 15, 2024 · 34 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 High Priority

Comments

@m-natarajan
Copy link

m-natarajan commented Apr 15, 2024

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: Needs reproduction
Reproducible in staging?: N/A
Reproducible in production?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers): @quinthar
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @quinthar
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1712886605520589

Action Performed:

  1. Open NewDot being online
  2. Observe there is a message " You appear to be offline"
  3. Do some actions and check the API request

Expected Result:

  • " You appear to be offline" should not show when online
  • If offline then success 200 OK API request should not be showin
  • No pusher notification
    Add something to the logs that will help diagnose this

Actual Result:

  • " You appear to be offline" message appears when online
  • Success 200 OK API request appears
  • Push notification is received
    I don't see anything useful in the logs. Can we maybe improve the logging around whatever code we use to determine if we're online to output its logic so we can diagnose and fix it.

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

image (4)

image (5)

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016051a56c40abfc4a
  • Upwork Job ID: 1782729213837856768
  • Last Price Increase: 2024-04-23
  • Automatic offers:
    • nkdengineer | Contributor | 0
Issue OwnerCurrent Issue Owner: @sonialiap
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Apr 15, 2024
Copy link

melvin-bot bot commented Apr 15, 2024

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

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@m-natarajan m-natarajan changed the title [Reliability] Add logging around offline state [Reliability] Add logging around offline state to help diagnose bugs Apr 15, 2024
@quinthar quinthar changed the title [Reliability] Add logging around offline state to help diagnose bugs HIGH: [Reliability] Add logging around offline state to help diagnose bugs Apr 16, 2024
@melvin-bot melvin-bot bot added the Overdue label Apr 18, 2024
Copy link

melvin-bot bot commented Apr 19, 2024

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

@sonialiap
Copy link
Contributor

I can reproduce, but not consistently. Sometimes when I open ND the "you're offline" message appears and then usually clears within 30 seconds. If I open ND, close, and immediately open a new tab with ND the message doesn't appear. It seems to require some time between opening ND in a new tab for it to show as offline

@melvin-bot melvin-bot bot removed the Overdue label Apr 23, 2024
@sonialiap sonialiap added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Apr 23, 2024
@melvin-bot melvin-bot bot changed the title HIGH: [Reliability] Add logging around offline state to help diagnose bugs [$250] HIGH: [Reliability] Add logging around offline state to help diagnose bugs Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 23, 2024
Copy link

melvin-bot bot commented Apr 23, 2024

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Apr 23, 2024

Proposal

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

Nothing useful in the logs to debug online/offline issues

What is the root cause of that problem?

We don't have such logs.

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

There're 3 places we're setting offline status via setOfflineStatus, we should add additional logs with the context by Log.info

  1. In
    setOfflineStatus(true);

    We should log:
Log.info(`[NetworkStatus] Setting "offlineStatus" to "true" because user is under force offline`);
  1. In
    NetInfo.fetch().then((state) => setOfflineStatus((state.isInternetReachable ?? false) === false));

We should log the full state that NetInfo returned

Log.info(`[NetworkStatus] The user is not under force offline, calling NetInfo.fetch, setting "offlineStatus" to ${(state.isInternetReachable ?? false) === false} with network state: ${JSON.stringify(state)}`);
  1. In
    setOfflineStatus((state.isInternetReachable ?? false) === false);

We should log the full state that NetInfo returned, and mention that this is set in NetInfo.addEventListener

Log.info(`[NetworkStatus] NetInfo.addEventListener event coming, setting "offlineStatus" to ${(state.isInternetReachable ?? false) === false} with network state: ${JSON.stringify(state)}`);

We can logs the logic we use to determine offline status (state.isInternetReachable ?? false) === false, if that's necessary.

Those are the core places we need the logs, the specifics of the log content/params can be adjusted in the PR phase.

What alternative solutions did you explore? (Optional)

Currently we have only true/false network status, if later we decide to have enum/number/string network statuses, then we need to log that value in the same way.

@melvin-bot melvin-bot bot added the Overdue label Apr 25, 2024
Copy link

melvin-bot bot commented Apr 26, 2024

@sonialiap, @Santhosh-Sellavel Whoops! This issue is 2 days overdue. Let's get this updated quick!

@quinthar
Copy link
Contributor

What's the next step here, and the ETA?

@quinthar quinthar changed the title [$250] HIGH: [Reliability] Add logging around offline state to help diagnose bugs HIGH: [Reliability] [$250] Add logging around offline state to help diagnose bugs Apr 27, 2024
@quinthar quinthar changed the title HIGH: [Reliability] [$250] Add logging around offline state to help diagnose bugs HIGH: [Debugability] [$250] Add logging around offline state to help diagnose bugs Apr 27, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

@sonialiap @Santhosh-Sellavel 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!

@Santhosh-Sellavel
Copy link
Collaborator

@nkdengineer's proposal LGTM!

C+ Reviewed
🎀 👀 🎀

@melvin-bot melvin-bot bot removed the Overdue label Apr 29, 2024
@melvin-bot melvin-bot bot removed the Weekly KSv2 label May 30, 2024
Copy link

melvin-bot bot commented May 30, 2024

This issue has not been updated in over 15 days. @sonialiap, @Santhosh-Sellavel, @hayata-suenaga, @nkdengineer 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!

@melvin-bot melvin-bot bot added the Monthly KSv2 label May 30, 2024
@hayata-suenaga hayata-suenaga added Weekly KSv2 Monthly KSv2 and removed Monthly KSv2 Reviewing Has a PR in review labels Jun 3, 2024
@hayata-suenaga
Copy link
Contributor

The PR has been merged

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 Monthly KSv2 labels Jun 6, 2024
@melvin-bot melvin-bot bot changed the title MEDIUM: [$250] Add logging around offline state to help diagnose bugs [HOLD for payment 2024-06-13] MEDIUM: [$250] Add logging around offline state to help diagnose bugs Jun 6, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

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

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

Copy link

melvin-bot bot commented Jun 6, 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:

  • [@hayata-suenaga] The PR that introduced the bug has been identified. Link to the PR:
  • [@hayata-suenaga] 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:
  • [@hayata-suenaga] 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:
  • [@Santhosh-Sellavel / @nkdengineer] Determine if we should create a regression test for this bug.
  • [@Santhosh-Sellavel / @nkdengineer] 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.
  • [@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@hayata-suenaga
Copy link
Contributor

[@hayata-suenaga] The PR that introduced the bug has been identified. Link to the PR:

This issue not a bug fix. It's about adding a logging

[@hayata-suenaga] 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:

N/A

[@hayata-suenaga] 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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 12, 2024
@sonialiap
Copy link
Contributor

Payment summary
@Santhosh-Sellavel $250 - please request in ND
@nkdengineer $250 - offer sent

Please complete the two steps on the checklist

@melvin-bot melvin-bot bot added the Overdue label Jun 17, 2024
@sonialiap
Copy link
Contributor

@nkdengineer please accept the offer so that I can issue payment

@melvin-bot melvin-bot bot removed the Overdue label Jun 17, 2024
@nkdengineer
Copy link
Contributor

nkdengineer commented Jun 17, 2024

@sonialiap Could you help to add the High Priority label to the issue, similar to this case? This was HIGH priority when the issue was opened, and only changed after the PR is up.

Screenshot 2024-06-17 at 6 07 50 PM

@hayata-suenaga
Copy link
Contributor

@sonialiap, just as a note, the PR causes a regression although I'm not familiar with the policy on how regressions affect the bounty amount 🤔

@sonialiap
Copy link
Contributor

sonialiap commented Jun 18, 2024

Thanks for the flag, @hayata-suenaga. In the case of regression the fee is reduced by 50% (source)

I think @nkdengineer 's request is reasonable because this issue was labeled as High April 16, the proposal was posted on April 23 and PR submitted after that. The issue was changed to Medium on May 12. Since the work was done while the issue was labeled as High, I think it's reasonable to update the price to $500.

With the regression the price falls to $250

Payment summary remains the same

@nkdengineer
Copy link
Contributor

@sonialiap Thank you, I accepted the sent offer 🙇

@sonialiap
Copy link
Contributor

Since this is update is for improving logging, I don't think we need a regression test. Closing

@github-project-automation github-project-automation bot moved this from MEDIUM to Done in [#whatsnext] #quality Jun 18, 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 High Priority
Projects
Development

No branches or pull requests

8 participants