Skip to content
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

fix: allow url async calls to run in parallel #394

Merged
merged 20 commits into from Aug 29, 2022

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Aug 27, 2022

New Pull Request Checklist

Issue Description

Since async/await calls were introduced it made it a lot easier developers to make many async calls in parallel. Depending on how these async calls are made it's possible there can be a race condition in session delegates.

Also fixes a memory leak issue with Parse URL Session.

Related issue: #347

Approach

Use an actor for the url session delegates to ensure thread safety.

The updates make the test suite pass Xcode 14 beta 5 & 6.

TODOs before merging

  • Add tests
  • Add entry to changelog

@parse-github-assistant
Copy link

parse-github-assistant bot commented Aug 27, 2022

Thanks for opening this pull request!

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

@cbaker6
Copy link
Contributor Author

cbaker6 commented Aug 27, 2022

@vdkdamian can you try this branch out and let me know if you still see the issue you had?

@cbaker6 cbaker6 linked an issue Aug 27, 2022 that may be closed by this pull request
4 tasks
@cbaker6 cbaker6 mentioned this pull request Aug 27, 2022
4 tasks
@codecov
Copy link

codecov bot commented Aug 27, 2022

Codecov Report

Merging #394 (e52969c) into main (e3e861d) will increase coverage by 0.43%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #394      +/-   ##
==========================================
+ Coverage   89.28%   89.72%   +0.43%     
==========================================
  Files         157      157              
  Lines       14970    15072     +102     
==========================================
+ Hits        13366    13523     +157     
+ Misses       1604     1549      -55     
Impacted Files Coverage Δ
Sources/ParseSwift/API/API+Command.swift 89.38% <100.00%> (+0.17%) ⬆️
...urces/ParseSwift/API/ParseURLSessionDelegate.swift 100.00% <100.00%> (+84.21%) ⬆️
Sources/ParseSwift/Extensions/URLSession.swift 80.46% <100.00%> (+3.29%) ⬆️
Sources/ParseSwift/Parse.swift 91.35% <100.00%> (+0.07%) ⬆️
Sources/ParseSwift/Objects/ParseObject.swift 87.44% <0.00%> (+0.14%) ⬆️
Sources/ParseSwift/Objects/ParseUser.swift 86.34% <0.00%> (+0.16%) ⬆️
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 76.75% <0.00%> (+0.58%) ⬆️

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

@vdkdamian
Copy link
Contributor

@vdkdamian can you try this branch out and let me know if you still see the issue you had?

Yes, give me some time. I'll try it as fast as possible

@cbaker6 cbaker6 merged commit 15d1724 into parse-community:main Aug 29, 2022
@cbaker6 cbaker6 deleted the fixAsync branch August 29, 2022 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

withThrowingTaskGroup causes crash
2 participants