Parse-Swift icon indicating copy to clipboard operation
Parse-Swift copied to clipboard

fix: add barrier for thread safety

Open vdkdamian opened this issue 2 years ago • 7 comments

New Pull Request Checklist

  • [x] I am not disclosing a vulnerability.
  • [x] I am creating this PR in reference to an issue.

Issue Description

This fixes an issue when downloading or uploading multiple items in ParseSwift that was caused by a thread-safety issue.

Related issue: #347

Approach

This PR adds a barrier to fix the related issue

TODOs before merging

  • [ ] Add entry to changelog
  • [x] Lint

vdkdamian avatar Mar 02 '22 17:03 vdkdamian

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@cbaker6 Why are the checks failing?

vdkdamian avatar Mar 03 '22 05:03 vdkdamian

@cbaker6 Why are the checks failing?

Not sure, maybe you can set break points on the failing tests and your changes to determine where the failures are coming from?

cbaker6 avatar Mar 03 '22 12:03 cbaker6

Not sure, maybe you can set break points on the failing tests and your changes to determine where the failures are coming from?

I tested it in my app and it works perfectly, but the tests are failing.

It's coming from the test [ParseSwiftTests.ParseFileAsyncTests testFetchFileProgress]. Schermafbeelding 2022-03-03 om 19 32 34

vdkdamian avatar Mar 03 '22 18:03 vdkdamian

Codecov Report

Merging #348 (a888b84) into main (675168e) will decrease coverage by 0.07%. The diff coverage is 62.10%.

@@            Coverage Diff             @@
##             main     #348      +/-   ##
==========================================
- Coverage   89.17%   89.09%   -0.08%     
==========================================
  Files         156      156              
  Lines       14553    14605      +52     
==========================================
+ Hits        12977    13013      +36     
- Misses       1576     1592      +16     
Impacted Files Coverage Δ
...urces/ParseSwift/API/ParseURLSessionDelegate.swift 12.67% <0.00%> (-3.12%) :arrow_down:
Sources/ParseSwift/LiveQuery/LiveQuerySocket.swift 69.49% <67.56%> (+4.78%) :arrow_up:
Sources/ParseSwift/API/API+Command.swift 89.36% <100.00%> (+0.15%) :arrow_up:
Sources/ParseSwift/Extensions/URLSession.swift 78.63% <100.00%> (+1.46%) :arrow_up:
Sources/ParseSwift/Objects/ParseUser.swift 85.62% <0.00%> (-0.18%) :arrow_down:

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

codecov[bot] avatar Mar 04 '22 16:03 codecov[bot]

@vdkdamian can you try the latest branch in your code to see if you still run into the crash in your app?

cbaker6 avatar Mar 05 '22 01:03 cbaker6

@vdkdamian can you try the latest branch in your code to see if you still run into the crash in your app?

Yes, the crash is back. Schermafbeelding 2022-03-05 om 08 23 07

vdkdamian avatar Mar 05 '22 07:03 vdkdamian

Closing in favor of #394

cbaker6 avatar Aug 27 '22 23:08 cbaker6