apple / apple/sample-cloudkit-sync-engine

var listID: String

オープン
#10 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Swift
スター
270
フォーク
15
PR マージ指標
30日以内にマージされた PR はありません

説明

### 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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

ContactsList.swiftを開き、Contact拡張と現在のlistID実装を調べます。提案どおりにリスト識別子を更新し、その後、連絡先名以外のフィールドが変更されたときに、cloudから取得した変更によってリスト項目が更新されることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
swift
領域
mobile-dev
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。