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: improve threading support for .current objects #45

Merged
merged 14 commits into from
Jan 14, 2023
Merged

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Jan 14, 2023

New Pull Request Checklist

Issue Description

Depending on how .current objects are used in an app, crashes can occur due to threading. Close #46

Approach

Add a synchronization queue to all .current objects.

TODOs before merging

  • Add tests
  • Add entry to changelog

@cbaker6
Copy link
Member Author

cbaker6 commented Jan 14, 2023

@bcbeta can you see if the this branch addresses your problem in #37?

@codecov
Copy link

codecov bot commented Jan 14, 2023

Codecov Report

Merging #45 (bd283ca) into main (9c70348) will decrease coverage by 0.00%.
The diff coverage is 98.55%.

@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   90.31%   90.30%   -0.01%     
==========================================
  Files         161      163       +2     
  Lines       16243    16322      +79     
==========================================
+ Hits        14670    14740      +70     
- Misses       1573     1582       +9     
Impacted Files Coverage Δ
...es/ParseSwift/Protocols/ParseCloudable+async.swift 100.00% <ø> (ø)
.../ParseSwift/Protocols/ParseCloudable+combine.swift 100.00% <ø> (ø)
Sources/ParseSwift/Protocols/ParseCloudable.swift 100.00% <ø> (ø)
Sources/ParseSwift/Storage/KeychainStore.swift 96.58% <ø> (ø)
...es/ParseSwift/Storage/ParsePrimitiveStorable.swift 94.73% <ø> (ø)
Sources/ParseSwift/Types/ParseHealth.swift 100.00% <ø> (ø)
Sources/ParseSwift/Storage/ParseStorage.swift 82.14% <75.00%> (ø)
Sources/ParseSwift/Utility.swift 97.56% <97.56%> (ø)
Sources/ParseSwift/API/API.swift 99.35% <100.00%> (ø)
Sources/ParseSwift/Extensions/URLSession.swift 86.37% <100.00%> (-1.36%) ⬇️
... and 16 more

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

Sources/ParseSwift/Utility.swift Fixed Show fixed Hide fixed
Sources/ParseSwift/Utility.swift Fixed Show fixed Hide fixed
@cbaker6 cbaker6 changed the title fix: improve threading support fix: improve threading support for .current objects Jan 14, 2023
@cbaker6 cbaker6 merged commit 4625758 into main Jan 14, 2023
@cbaker6 cbaker6 deleted the threading branch January 14, 2023 19:38
@bcbeta
Copy link

bcbeta commented Jan 14, 2023

@bcbeta can you see if the this branch addresses your problem in #37?

I will get a release out next week and let you know how it goes. Thanks!

@cbaker6
Copy link
Member Author

cbaker6 commented Jan 18, 2023

I will get a release out next week and let you know how it goes. Thanks!

When you try, you can link to tag https://github.com/netreconlab/Parse-Swift/releases/tag/5.0.0-beta.2

Note that there's a small breaking change when initializing the Swift SDK, you can choose add try to catch any errors or try? to ignore all errors. See below for an example:

do {
try initializeParse()
} catch {
assertionFailure("Error initializing Parse-Swift: \(error)")
}

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.

ParseInstallation crashes the application
2 participants