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

feat: retry URL connection on error #291

Merged
merged 6 commits into from
Nov 30, 2021
Merged

feat: retry URL connection on error #291

merged 6 commits into from
Nov 30, 2021

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Nov 29, 2021

New Pull Request Checklist

Issue Description

If a URL response error is received, the SDK currently returns the error to the developer without retrying. This causes the developer to handle retries themselves.

Fixed additional bugs:

  • Fixed an issue where an annonymous couldn't be turned into a regular user using signup
  • The default ACL is now deleted from the keychain when a user is logged out. This previously caused an issue when logging out a user and logging in as a different user caused all objects to only have ACL permisions for the logged in user

Related issue: #n/a

Approach

Add a retry mechanism to the SDK that randomly (up to 3 seconds each) tries to reconnect up to 5 times. The developer can increase or reduce the amount of retries when configuring the SDK.

TODOs before merging

  • Add tests
  • Improve and simplify sync/async URL execution
  • Fix bugs
  • Updated Playgrounds
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 29, 2021

Thanks for opening this pull request!

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

@codecov
Copy link

codecov bot commented Nov 29, 2021

Codecov Report

Merging #291 (d704ad4) into main (ae47862) will decrease coverage by 0.08%.
The diff coverage is 83.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
- Coverage   82.46%   82.38%   -0.09%     
==========================================
  Files         104      104              
  Lines       10607    10659      +52     
==========================================
+ Hits         8747     8781      +34     
- Misses       1860     1878      +18     
Impacted Files Coverage Δ
Sources/ParseSwift/Objects/ParseInstallation.swift 77.71% <59.25%> (+0.08%) ⬆️
Sources/ParseSwift/Extensions/URLSession.swift 72.46% <68.75%> (-0.64%) ⬇️
Sources/ParseSwift/API/API+Command.swift 82.47% <70.12%> (-1.71%) ⬇️
...urces/ParseSwift/API/API+NonParseBodyCommand.swift 75.48% <76.92%> (+0.31%) ⬆️
Sources/ParseSwift/Types/ParseFile.swift 79.80% <87.50%> (-0.33%) ⬇️
Sources/ParseSwift/Objects/ParseUser.swift 80.31% <91.46%> (+0.27%) ⬆️
Sources/ParseSwift/Objects/ParseObject.swift 76.11% <93.33%> (+0.10%) ⬆️
...Authentication/Protocols/ParseAuthentication.swift 71.27% <100.00%> (+0.29%) ⬆️
Sources/ParseSwift/Coding/ParseEncoder.swift 73.88% <100.00%> (+0.06%) ⬆️
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 72.92% <100.00%> (-0.16%) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae47862...d704ad4. Read the comment docs.

@cbaker6 cbaker6 merged commit 4734212 into main Nov 30, 2021
@cbaker6 cbaker6 deleted the retry branch November 30, 2021 05:49
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.

1 participant