apple / apple/sample-cloudkit-sync-engine

var listID: String

Open
#10 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
270
Forks
15
PR merge metrics
No merged PRs in 30d

Description

### In ContactsList.swift extension Contact

`// In order for the list to update properly when fetch changes from the cloud, we need to use something other than the contact ID for the list item ID.`
`var listID: String { "\(self.id)\(Self.listIDSeparator)\(self.name)" }`

The problem with this approach is when you start adding more fields to Contact. Your approach doesn't guarantee updates when changes are fetched.

I propose changing to the following:
`var listID: String { "\(self.id)\(Self.listIDSeparator)\(self.userModificationDate)" }`

In my testing, this solves all update issues regardless of adding fields to Contact.

Thoughts?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.