parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 735 forks source link

fix: exception on concurrent download of `ParseFile` from multiple threads #1179

Closed techyourchance closed 2 years ago

techyourchance commented 2 years ago

New Pull Request Checklist

Issue Description

Related issue: #1155

Approach

This PR simplifies the logic of fetchAsync method and then adds a concurrent code that blocks the second (and further) calling threads until the first thread finishes the download of ParseFile (or fails to do so).

TODOs before merging

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this pull request!

codecov[bot] commented 2 years ago

Codecov Report

Merging #1179 (d5c50f4) into master (351858c) will not change coverage. The diff coverage is 0.00%.

@@          Coverage Diff           @@
##           master   #1179   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         122     122           
  Lines        9962    9970    +8     
  Branches     1343    1345    +2     
======================================
- Misses       9962    9970    +8     
Impacted Files Coverage Δ
...e/src/main/java/com/parse/ParseFileController.java 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

rommansabbir commented 2 years ago

Thanks for the fix! Could you take a look at the failing lint test?

I will take a look at the fail and it seems like Spotless not applied.

rommansabbir commented 2 years ago

@techyourchance @mtrezza Closing this PR as created a new PR (#1180) by fixing the CI failing issue for Spotless violations.