-
Notifications
You must be signed in to change notification settings - Fork 3k
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-10-22] [HOLD for payment 2024-07-24] [$250] ping
and ReconnectApp
are called back to back on a bad wifi network
#44269
Comments
Triggered auto assignment to @kadiealexander ( |
Triggered auto assignment to @srikarparsi ( |
Making this external to see if there's a reliable way to reproduce, the root cause, and proposals to fix. |
ping
and ReconnectApp
are called back to back on a bad wifi networkping
and ReconnectApp
are called back to back on a bad wifi network
Job added to Upwork: https://www.upwork.com/jobs/~01f591c76409c7f4d0 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane ( |
This feels extremely easy to reproduce: just close your laptop lid for a few minutes, and reopen. |
I just tried this (closing laptop and reopen) and this was my network tab: ![]() 2 pings were called which isn't as many as your screenshot here but it's still back to back pings which shouldn't happen. We already have a check to make sure that we don't send a Ping command when one is pending and this seems to be working because I don't see So I have two theories:
I'm still looking into these but they are my initial thoughts based on the code. cc @roryabraham and @adhorodyski if you have any additional thoughts since you guys worked on these PRs to introduce NetInfo and periodic checks. |
@srikarparsi you're correct about the periodic check. The call itself feels solid, as it should bail out if only the function early return kicks in (which from the logs looks fine, no subsequent If |
On higher-level problem I see with this implementation is that's it's really, really imperative so it's easy to make a mistake and cause such a behaviour over time. Declarative APIs work better especially with React codebases and there are open source libraries to solve just that. |
I created this PR to check if a network check is pending before starting a new one. Still need to test but I think this would be a quick way to stop repetitive calls. @adhorodyski if you could take a look at it as well that would be appreciated. I also agree that our current implementation might not be the best way of doing it. NetInfo has parameters that we seem to be implementing in a custom way. For example, NetInfo already has reachabilityShortTimeout and reachabilityLongTimeout which are defaulted to 5s and 60s. So when the internet is not detected, it should be rechecking for connection every 5s. And when it is detected, it should be rechecking every 60s. But we had to re-add the 60s check in this PR so I think there might just be something wrong with our current implementation which we need to fix. |
I wasn’t able to reproduce this issue by closing and opening the laptop lid. Every time I tried, the Given this, I think adding this additional check makes sense as it ensures that a new network check only starts if there isn't already one in progress. |
ping
and ReconnectApp
are called back to back on a bad wifi networkping
and ReconnectApp
are called back to back on a bad wifi network
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 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-07-24. 🎊 For reference, here are some details about the assignees on this issue:
|
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:
|
|
Payouts due:
|
Woohoo! Great work |
$250 approved for @rushatgabhane |
I have prepared a PR with updated code from It is worth noting that this change has been approved and merged by the maintainer. But since we are patching this library instead of forking it, it needs to be updated as above. |
ping
and ReconnectApp
are called back to back on a bad wifi networkping
and ReconnectApp
are called back to back on a bad wifi network
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.48-2 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-10-22. 🎊 For reference, here are some details about the assignees on this issue:
|
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:
|
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:
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
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: @quinthar
Slack conversation: https://expensify.slack.com/archives/C05LX9D6E07/p1719023935665339
Action Performed:
Expected Result:
Shouldn't call
ping
andreconnectApp
several timesActual Result:
on a really bad wifi network, where it concludes it's online but for some reason can't contact the server, it just hammers
Ping
andReconnectApp
back to back, filling the network queue with tons of parallel unfinished commands.Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
bugd.txt
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @kadiealexanderThe text was updated successfully, but these errors were encountered: