Merged
Conversation
…nsError to signal refreshing has expired; Unit tests added.
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #827 +/- ##
==========================================
+ Coverage 84.24% 84.32% +0.08%
==========================================
Files 59 59
Lines 4906 4926 +20
==========================================
+ Hits 4133 4154 +21
+ Misses 773 772 -1
|
Contributor
Author
|
List of accepted breaking changes:
|
kried
reviewed
Jun 13, 2024
| credentials: BogusCredentials, | ||
| refreshTTL: refreshTTL) | ||
|
|
||
| XCTAssertNotNil(response.refreshTTL) |
Contributor
Author
There was a problem hiding this comment.
Equality is checked below.
|
|
||
| public init(code: String?, message: String?, response: URLResponse?, underlyingError error: Error?) { | ||
| public init(code: String?, message: String?, response: URLResponse?, underlyingError error: Error?, refreshTTL: Int? = nil) { | ||
| guard refreshTTL == nil || refreshTTL != 0 else { |
Contributor
There was a problem hiding this comment.
Are we sure that in the case when refreshTTL == 0 and e.g. response.statusCode == 404 the error should be . refreshExpired?
As for me, it's better first to check the non-200 response code and only then check refreshTTL.
Btw, how does the Android platform handle this case?
Contributor
Author
There was a problem hiding this comment.
refresh_ttl in the refresh response will be appended and =0 only in case of the refresh invalidation error. Android also does the check for this parameter to be 0
kried
approved these changes
Jun 13, 2024
Docs corrections Co-authored-by: Nastassia Makaranka <nastassia.makaranka@mapbox.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added route response refresh TTL field and a
DirectionsErrorto signal refreshing has expired