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: Throw an error if the SDK isn't init in 5 seconds #73

Merged
merged 3 commits into from
Mar 12, 2023
Merged

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Mar 12, 2023

New Pull Request Checklist

Issue Description

If the developer starts using the Swift SDK, but never never initializes it, running tasks can run in an infinite loop.

Approach

Throw an error if a task is started an runs for 5 seconds when the Swift SDK is never initialized.

TODOs before merging

  • Add tests
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@codecov
Copy link

codecov bot commented Mar 12, 2023

Codecov Report

Merging #73 (e6b063a) into main (0fbb915) will decrease coverage by 0.09%.
The diff coverage is 68.71%.

@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
- Coverage   90.63%   90.55%   -0.09%     
==========================================
  Files         169      169              
  Lines       15072    15085      +13     
==========================================
- Hits        13661    13660       -1     
- Misses       1411     1425      +14     
Impacted Files Coverage Δ
Sources/ParseSwift/Extensions/URLSession.swift 83.33% <22.22%> (+1.04%) ⬆️
Sources/ParseSwift/API/API+Command.swift 86.46% <59.42%> (-0.68%) ⬇️
...urces/ParseSwift/API/API+NonParseBodyCommand.swift 79.22% <63.15%> (-1.74%) ⬇️
Sources/ParseSwift/Parse.swift 97.10% <92.59%> (-0.89%) ⬇️
Sources/ParseSwift/API/API.swift 99.40% <100.00%> (ø)
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 70.84% <100.00%> (-0.59%) ⬇️
Sources/ParseSwift/Objects/ParseInstallation.swift 88.31% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseUser.swift 90.78% <100.00%> (ø)
Sources/ParseSwift/Protocols/ParseConfig.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Types/ParseConfigCodable.swift 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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

@@ -203,7 +203,8 @@
}

// swiftlint:disable:next cyclomatic_complexity
internal static func getHeaders(options: API.Options) async -> [String: String] {
internal static func getHeaders(options: API.Options) async throws -> [String: String] {

Check warning

Code scanning / Tailor (reported by Codacy)

Function should have at least one blank line after it

Function should have at least one blank line after it
An example application that demonstrates how to convert from the Objective-C SDK to the Swift SDK can be found at [ParseMigrateKeychain](https://github.com/netreconlab/ParseMigrateKeychain). Specifically, look at [ContentViewModel.swift](https://github.com/netreconlab/ParseMigrateKeychain/blob/main/ParseMigrateKeychain/ContentViewModel.swift) for code examples. The basic steps are below:
1. See the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/74) to learn how to migrate from Parse-Swift<sup>OG</sup> 4.15.0+ to 5.1.1+
1. See the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/70) to learn how to migrate from the [Parse-Swift](https://github.com/parse-community/Parse-Swift)
1. See the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/71) to learn how to migrate from the [Parse-SDK-iOS-OSX](https://github.com/parse-community/Parse-SDK-iOS-OSX)

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when the list item marker values of ordered lists violate a given

[ordered-list-marker-value] Marker should be `3`, was `1`

An example application that demonstrates how to convert from the Objective-C SDK to the Swift SDK can be found at [ParseMigrateKeychain](https://github.com/netreconlab/ParseMigrateKeychain). Specifically, look at [ContentViewModel.swift](https://github.com/netreconlab/ParseMigrateKeychain/blob/main/ParseMigrateKeychain/ContentViewModel.swift) for code examples. The basic steps are below:
1. See the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/74) to learn how to migrate from Parse-Swift<sup>OG</sup> 4.15.0+ to 5.1.1+
1. See the [discussion](https://github.com/netreconlab/Parse-Swift/discussions/70) to learn how to migrate from the [Parse-Swift](https://github.com/parse-community/Parse-Swift)

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when the list item marker values of ordered lists violate a given

[ordered-list-marker-value] Marker should be `2`, was `1`
@cbaker6 cbaker6 merged commit 01c0b20 into main Mar 12, 2023
@cbaker6 cbaker6 deleted the pauseSDK branch March 12, 2023 23:47
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.

None yet

1 participant