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: ParseFile id creation should be consistent to ensure proper hashing #83

Merged
merged 5 commits into from
Mar 17, 2023

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Mar 17, 2023

New Pull Request Checklist

Issue Description

ParseFile generation of id is not constant, which could produce multiple file saves.

ParseFile also isn't Identifiable requiring extra work to use in SwiftUI.

Approach

  • Make the id generation of a ParseFile consistent so when the developer attempts to save multiple versions of the same file, the file is only saved once and replaced for other instances to reduce network calls
  • Mare ParseFile Identifiable

TODOs before merging

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

@@ -17,7 +17,7 @@
func prepareURLRequest(options: API.Options,
batching: Bool = false,
childObjects: [String: PointerType]? = nil,
childFiles: [UUID: ParseFile]? = nil) async -> Result<URLRequest, ParseError> {
childFiles: [String: ParseFile]? = nil) async -> Result<URLRequest, ParseError> {

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
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #83 (dedde27) into main (d1feb04) will decrease coverage by 3.00%.
The diff coverage is 64.70%.

❗ Current head dedde27 differs from pull request most recent head 67c76d6. Consider uploading reports for the commit 67c76d6 to get more accurate results

@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
- Coverage   90.55%   87.55%   -3.00%     
==========================================
  Files         169      128      -41     
  Lines       15098    12514    -2584     
==========================================
- Hits        13672    10957    -2715     
- Misses       1426     1557     +131     
Impacted Files Coverage Δ
Sources/ParseSwift/API/API+Command.swift 76.16% <ø> (-10.31%) ⬇️
Sources/ParseSwift/Objects/ParseObject.swift 90.95% <ø> (ø)
...s/ParseSwift/Objects/ParseInstallation+async.swift 91.35% <20.00%> (-1.32%) ⬇️
Sources/ParseSwift/Objects/ParseUser+async.swift 93.52% <20.00%> (-0.88%) ⬇️
Sources/ParseSwift/Objects/ParseObject+async.swift 94.36% <42.85%> (-1.86%) ⬇️
Sources/ParseSwift/Coding/ParseEncoder.swift 74.42% <72.72%> (-3.25%) ⬇️
Sources/ParseSwift/Types/ParseFile.swift 58.74% <85.71%> (-37.38%) ⬇️
Sources/ParseSwift/API/API+Command+async.swift 100.00% <100.00%> (ø)
...urces/ParseSwift/API/API+NonParseBodyCommand.swift 79.22% <100.00%> (ø)

... and 58 files 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.

@cbaker6 cbaker6 merged commit c371d5d into main Mar 17, 2023
@cbaker6 cbaker6 deleted the parsFile branch March 17, 2023 17:07
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