parse-community / Parse-Swift

The Swift SDK for Parse Platform (iOS, macOS, watchOS, tvOS, Linux, Android, Windows)
https://parseplatform.org
MIT License
308 stars 69 forks source link

fix: allow ParseRole to save when using custom objectId's #338

Closed cbaker6 closed 2 years ago

cbaker6 commented 2 years ago

New Pull Request Checklist

Issue Description

When the SDK is allowing custom objectId's, new users and roles can't be saved to ParseRole's.

This occurs because a ParseRelation has a target of Pointer<ParseObject>. Since a Parse Pointer doesn't have createdAt, an error is being thrown.

Related issue: #n/a

Approach

Since an ParseOperation can occur on a ParseObject or a ParseRelation, only check if the objectId is present on the target.

TODOs before merging

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this pull request!

codecov[bot] commented 2 years ago

Codecov Report

Merging #338 (a1932a3) into main (aa02ed9) will increase coverage by 0.04%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #338      +/-   ##
==========================================
+ Coverage   85.10%   85.15%   +0.04%     
==========================================
  Files         114      114              
  Lines       12208    12208              
==========================================
+ Hits        10390    10396       +6     
+ Misses       1818     1812       -6     
Impacted Files Coverage Δ
Sources/ParseSwift/Types/ParseOperation.swift 97.59% <100.00%> (+2.88%) :arrow_up:

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 aa02ed9...a1932a3. Read the comment docs.