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

Allow mixed custom objectId environment #222

Merged
merged 5 commits into from
Sep 2, 2021
Merged

Allow mixed custom objectId environment #222

merged 5 commits into from
Sep 2, 2021

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Aug 31, 2021

Properly allow a mixed custom objectId environment without compromising safety checks using .save(). If a developer wants to ignore the objectId checks, they need to specify isIgnoreCustomObjectIdConfig = true each time.

Added the following warning to the documentation:

If you are using ParseConfiguration.allowCustomObjectId = true and plan to generate all of your objectId's on the client-side then you should leave isIgnoreCustomObjectIdConfig = false. Setting ParseConfiguration.allowCustomObjectId = true and isIgnoreCustomObjectIdConfig = true means the client will generate objectId's and the server will generate an objectId only when the client does not provide one. This can increase the probability of colliding objectId's as the client and server objectId's may be generated using different algorithms. This can also lead to overwriting of ParseObject's by accident as the client-side checks are disabled. Developers are responsible for handling such cases.`

  • Add isIgnoreCustomObjectIdConfig to saves
  • Add test cases
  • Add documentation
  • Update change log
  • Prepare for release

@cbaker6 cbaker6 linked an issue Aug 31, 2021 that may be closed by this pull request
3 tasks
@cbaker6 cbaker6 requested a review from TomWFox August 31, 2021 17:13
@cbaker6
Copy link
Contributor Author

cbaker6 commented Aug 31, 2021

@TomWFox can you look through the documentation when you get a chance?

@codecov
Copy link

codecov bot commented Aug 31, 2021

Codecov Report

Merging #222 (f9be817) into main (f584819) will increase coverage by 0.00%.
The diff coverage is 96.07%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #222   +/-   ##
=======================================
  Coverage   83.59%   83.59%           
=======================================
  Files          76       76           
  Lines        7265     7284   +19     
=======================================
+ Hits         6073     6089   +16     
- Misses       1192     1195    +3     
Impacted Files Coverage Δ
Sources/ParseSwift/Operations/ParseOperation.swift 75.72% <0.00%> (ø)
Sources/ParseSwift/API/API+Commands.swift 86.84% <100.00%> (ø)
...ParseSwift/Objects/ParseInstallation+combine.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseInstallation.swift 79.48% <100.00%> (+0.19%) ⬆️
...urces/ParseSwift/Objects/ParseObject+combine.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseObject.swift 78.31% <100.00%> (+0.22%) ⬆️
Sources/ParseSwift/Objects/ParseUser+combine.swift 93.22% <100.00%> (+0.23%) ⬆️
Sources/ParseSwift/Objects/ParseUser.swift 82.84% <100.00%> (-0.05%) ⬇️
Sources/ParseSwift/Storage/KeychainStore.swift 97.75% <100.00%> (ø)
Sources/ParseSwift/Coding/AnyEncodable.swift 61.18% <0.00%> (-0.66%) ⬇️
... and 2 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 f584819...f9be817. Read the comment docs.

@cbaker6 cbaker6 merged commit ba3d60e into main Sep 2, 2021
@cbaker6 cbaker6 deleted the customObjectId branch September 2, 2021 13:13
@TomWFox
Copy link
Contributor

TomWFox commented Sep 4, 2021

I've been on holiday hence the delay ;)

It looks good 👍🏻

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.

Allow mixed environment of server generated and custom objectId
2 participants