Skip to content
This repository was archived by the owner on Jun 4, 2021. It is now read-only.

Fix for Incorrect Record ID#21

Open
jsorge wants to merge 4 commits intoBennyKJohnson:masterfrom
jsorge:ckrecord-inject-recordid
Open

Fix for Incorrect Record ID#21
jsorge wants to merge 4 commits intoBennyKJohnson:masterfrom
jsorge:ckrecord-inject-recordid

Conversation

@jsorge
Copy link
Contributor

@jsorge jsorge commented Aug 5, 2018

In my scenario I was looking up a single record by its CKRecordID. The record fetch came back nil because when it was constructed it had a new CKRecordID made in the initializer (giving me 2 different instances of the same record ID). The effect was that the hash was different and I would not get the record I wanted even though the fetch completed properly.

The fix is to inject an optional record ID and use it instead of constructing a new one.

I based this on the Xcode 10 branch I submitted #20 to address as well. I'd merge that one before this one to keep the changeset minimal.

jsorge added 4 commits August 4, 2018 08:53
When fetching records from CloudKit, a new recordID properyt was being created in the processing, which meant that the record IDs would be different instances, and the dictionary lookup could fail.
@jsorge jsorge force-pushed the ckrecord-inject-recordid branch from 43fffe1 to 88a09f3 Compare August 5, 2018 23:34
@jsorge jsorge mentioned this pull request Aug 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant