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: Installation not saving to keychain correctly, returning nil instead #236

Merged
merged 9 commits into from Sep 15, 2021

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Sep 14, 2021

New Pull Request Checklist

Issue Description

Installation not saving to the Keychain correctly, preventing the use of push notifications.

Related issue: #235

Approach

Save a BaseParseInstallation when initializing the SDK that can later be casted to the developers ParseInstallation.

When upgrading from previous versions of the SDK, this patch will attempt to fetch the installation from the Parse Server if it's available or else it will create a new one. If you added custom properties to your Installation you should call Installation.current?.fetch during SDK initialization to get the latest from the parse-server. Developers should also use cloud code/jobs to clean up any old installations that aren't being used anymore on the server.

TODOs before merging

  • Add tests
  • Add entry to changelog
  • Add changes to read me
  • Remove code duplication in spelling of variables
  • Prepare for new release

@parse-github-assistant
Copy link

parse-github-assistant bot commented Sep 14, 2021

Thanks for opening this pull request!

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

@cbaker6 cbaker6 linked an issue Sep 14, 2021 that may be closed by this pull request
4 tasks
@cbaker6
Copy link
Contributor Author

cbaker6 commented Sep 14, 2021

@lsmilek1 can you try out this branch and let me know if it works?

@codecov
Copy link

codecov bot commented Sep 14, 2021

Codecov Report

Merging #236 (e9ba4ca) into main (1a30fb6) will decrease coverage by 0.12%.
The diff coverage is 93.45%.

❗ Current head e9ba4ca differs from pull request most recent head 0037836. Consider uploading reports for the commit 0037836 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
- Coverage   83.73%   83.61%   -0.13%     
==========================================
  Files          78       78              
  Lines        7323     7360      +37     
==========================================
+ Hits         6132     6154      +22     
- Misses       1191     1206      +15     
Impacted Files Coverage Δ
...es/ParseSwift/Internal/BaseParseInstallation.swift 33.33% <33.33%> (-66.67%) ⬇️
Sources/ParseSwift/Parse.swift 98.24% <96.77%> (-1.76%) ⬇️
Sources/ParseSwift/API/API.swift 98.31% <100.00%> (ø)
...Authentication/Protocols/ParseAuthentication.swift 74.46% <100.00%> (ø)
Sources/ParseSwift/LiveQuery/Messages.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 74.38% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseInstallation.swift 80.50% <100.00%> (+1.01%) ⬆️
Sources/ParseSwift/Objects/ParseUser.swift 82.84% <100.00%> (-0.15%) ⬇️
Sources/ParseSwift/Types/ParseConfig.swift 97.26% <100.00%> (ø)
Sources/ParseSwift/Internal/Data+hexString.swift 68.96% <0.00%> (-31.04%) ⬇️
... and 4 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 1a30fb6...0037836. Read the comment docs.

@lsmilek1
Copy link
Contributor

The problem was solved, now I get installation always. Thank you!

@cbaker6 cbaker6 merged commit ddcf35f into main Sep 15, 2021
@cbaker6 cbaker6 deleted the currentInstallation branch September 15, 2021 02:08
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 not being saved in Keychain
2 participants