-
-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
IOException when app uses 3rd party SDK #422
Comments
@CodeBreak524 Could you provide us with some more info? What request occurs at the point where you see this exception? |
From what I can see this issue can be easily reproduced. Just delete the cache directory when app is running. chucker/library/src/main/java/com/chuckerteam/chucker/internal/support/AndroidCacheFileFactory.kt Line 21 in 392a63b
or by invoking Context#getCacheDir() on each file creation, not only at the init time: chucker/library/src/main/java/com/chuckerteam/chucker/internal/support/AndroidCacheFileFactory.kt Line 12 in 392a63b
Note that cacheDir may be null which is also unhandled by Chucker and reported in #414. |
It seems that behaviour described above by @koral-- is the same for my case. It always happens after giving control to IdNow SDK and it looks like it removes all cache files and directories of app while processing. Of course it is not correct behaviour in IdNow but I also suppose that Chucker should handle such cases without throwing an error for request |
I'm not sure if this can be reproduced this way. We have tests that should cover mentioned behaviour, and they are result of the error reported in #394. Unless this does not reproduce that or JVM behaves differently than Android when it comes to exceptions. chucker/library/src/test/java/com/chuckerteam/chucker/api/ChuckerInterceptorTest.kt Lines 284 to 316 in 6820473
|
I've added a test demonstrating this scenario. #423 |
Ok, so the fix would be to return From the design perspective, it might be good to open the possibility of passing the temp files directory in the constructor. This way users could provide more reliable directory from their perspective. The issue I see is that it would make usage of files public, which would require major version bump to remove from the constructor. Also, file usage might be too new to stick to it right now. @vbuberen @cortinico what do you think? |
I'm not sure if that is not an overengineering. IMHO the sufficient fix for this issue is to not save Additionally we can add nullcheck and probably throw some If I understand correctly |
Thanks, guys. Now it seems to be working without requests failing. Special thanks to @koral-- for providing cases and scenarios to reproduce the problem |
✍️ Describe the bug
This issue arises from #394
After fixes for #394 the reporter provided update that another exception appeared:
🔧 Expected behavior
Chucker works normally and shows transactions.
📱 Tech info
📄 Additional context
We should investigate the issue to either fix it or to get all the info we might need to deal with possible problems with other 3rd party SDKs.
The text was updated successfully, but these errors were encountered: