-
Notifications
You must be signed in to change notification settings - Fork 101
NetworkLogger issue - Multiple "Error - Request has not been opened" non-fatal error reports when using SDK 14.1.0 #1358
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
Comments
This issue has been automatically marked as pending feedback because we need additional information to be able to investigate it further. It will be closed in 7 days if it remains inactive. Thank you for your contributions. |
Please can you guys let me know what additional information you need? Since there is a minimal reproducer repository for the issue. |
@leonardorib Thanks for the detailed feedback, and reproducer! We will be looking into this one, and we will get back to you as soon as possible. |
This issue has been automatically marked as pending feedback because we need additional information to be able to investigate it further. It will be closed in 7 days if it remains inactive. Thank you for your contributions. |
we are also seeing this in production |
@gcottrell1 We got a snapshot from Instabug for this, try it out: |
This issue has been automatically marked as pending feedback because we need additional information to be able to investigate it further. It will be closed in 7 days if it remains inactive. Thank you for your contributions. |
This issue has been automatically marked as pending feedback because we need additional information to be able to investigate it further. It will be closed in 7 days if it remains inactive. Thank you for your contributions. |
This issue has been automatically closed since we haven't heard back from you. Please feel free to re-open the issue if you have more information to add. |
We are seeing the same issue. I think it's unsafe to overwrite the built in |
Uh oh!
There was an error while loading. Please reload this page.
Minimal reproducer
https://github.com/leonardorib/InstabugNetworkLoggerIssue
Steps
I recommend looking into the reproducer since it's already done. But here are the steps I'm following there:
NetInfo.fetch
. The first time you do it after app open it should trigger the issue.This does not happen on 14.0.0.
In order for the bug to be visible and reported to Instabug you need to be on a release build, because this is an Unhandled promise rejection. Alternatively if you want to see it in DEV, you can include logs in the react-native file that throws that error. In the minimal repro I provided I'm including a patch doing that so you can use it to see it in dev.
Details and investigation
After trying out upgrade from Instabug 14.0.0 to 14.1.0 we started to see a bunch of
non-fatal errors on the "Crashes" section on our dashboard for the release build with the following message:
Error - Request has not been opened
The error is thrown from this react-native file: https://github.com/facebook/react-native/blob/110450105e140d0846c63d3d15f356beefaeb020/packages/react-native/Libraries/Network/XMLHttpRequest.js#L540. I verified by manually insertting logs there in my node_modules/eract-native.
Reverting back to 14.0.0 solves it. We stop getting those.
After some debugging I found that when Instabug's Network Logger is enabled, some http requests from the connectivity checks done with @react-native-community/netinfo (a pretty standard package to check for network status) start to throw that error. So disabling the Network Logger on 14.1.0 also solves it.
The first underlying request it does when you try like
NetInfo.fetch
will trigger that. And you can't catch it. You can simulate the first request by recallingNetInfo.configure
to reset it's state.Potential dangerous change from 14.0.0 to 14.1.0 that is probably the cause
I looked at the changes from 14.0 to 14.1 and found something that can cause issues.
React-native original XMLHttpRequest implementation
This is the original
XMLHttpRequest
send
method implementation from react-native:https://github.com/facebook/react-native/blob/110450105e140d0846c63d3d15f356beefaeb020/packages/react-native/Libraries/Network/XMLHttpRequest.js#L538
Where
send
has this signature:How Instabug 14.0.0 overrides it
This is the override done by Instabug 14.0.0 on the XhrNetworkInterceptor when you have the Network Logger enabled:
Instabug-React-Native/src/utils/XhrNetworkInterceptor.ts
Line 94 in 6692f7b
Method is still
How Instabug 14.1.0 overrides it
This is it on Instabug 14.1.0:
Instabug-React-Native/src/utils/XhrNetworkInterceptor.ts
Line 178 in 2b094ca
So now the method turns into
because it is doing:
So something that is originally sync is now being overriden with an async operation
that can have some delay before resolving.
This can break stuff that was relying on the sync behavior.
So I tried manually doing this on 14.1.0:
Which is basically only removing the new "await call" in there and making it a sync function again. And it fixes the issue. Can't repro anymore even with NetworkLogger enabled after doing that.
The text was updated successfully, but these errors were encountered: