-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Crash when fetching ParseFile for the second time #1155
Comments
Thanks for opening this issue!
|
I wonder whether we can add a test case to demo this? I noticed that the file path looks strange:
Is a directory name even allowed to contain a colon |
@vzukanov Any updates on this? |
@mtrezza , not sure what kind of update I can give. This looks like a concurrency bug somewhere inside the lib. We worked around this problem by keeping track of the files we're downloading during sync and preventing concurrent calls to
|
…f the same ParseFile from multiple threads
@mtrezza , I decided to try and fix this bug myself. Please review the linked PR and let me know what you think (this is another GitHub account of vzukanov). |
PR Merged: #1180 |
New Issue Checklist
Issue Description
I have ParseObject that stores a file (~30MB PDF). When I attempt to get the file in Android, everything works as expected. This is the approaximate flow (executed on a background thread):
However, in some situations, the same flow can be triggered for the second time (from different entry point) before Parse Android SDK managed to download the contents of the file from the server. In that case, the following RuntimeException is thrown.
Looks like Android SDK doesn’t handle this scenario of concurrent fetching of the same file from multiple threads. I see this issue from 2016 which reported basically the same problem.
Steps to reproduce
Fetch the same ParseFile from multiple threads
Actual Outcome
Exception thrown
Expected Outcome
SDK "merges" all concurrent requests for the same file into one download and cache flow and notifies all waiting threads when the file is available
Environment
Parse Android SDK
3.0.0
Android 11
Server
4.10.4
Ubuntu 20.04
DigitalOcean
Database
MongoDb
Logs
The text was updated successfully, but these errors were encountered: