Implementation flaw
还没有人认领这个 Issue。
评估
调研方向
从 SyncedDatabase 的第 350 行开始,检查 pendingRecordZoneChanges 和 stateUpdate 事件的处理方式。评估 issue 中描述的崩溃窗口以及提议的异步 API 更改;只有在 maintainer 确认已解决数据丢失或 API 设计方面的问题后,才算完成。
由索引模型根据 Issue 内容生成。
描述
Hi there,
I think there is an implementation error in the sample project - more specifically, a flaw in the design of CKSyncEngine.
In the SyncedDatabase file, line 350:
self.syncEngine.state.add(pendingRecordZoneChanges: pendingSaves)
This tells the syncEngine what to do when the time is right. Since this piece of information is not persisted in this call (I think its persisted in .stateUpdate(let event)), there is a chance that this information is lost if the app crashes between .add(pendingRecordZoneChanges: pendingSaves) and .stateUpdate(let event).
I know this is just a sample project, but I really think this is a flaw in the API design of CKSyncEngine since I do not see an easy way to guarantee correct behavior. A simple fix would be to make .add(pendingRecordZoneChanges: pendingSaves) (and similar methods) async and only complete after .stateUpdate(let event) was called.
What do you think?
- 主要语言
- Swift
- 星标
- 270
- 派生
- 15
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apple/sample-cloudkit-sync-engine 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 28/100
apple/sample-cloudkit-sync-engine#17 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
apple/sample-cloudkit-sync-engine#15 · 6 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
apple/sample-cloudkit-sync-engine#13 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 42/100
apple/sample-cloudkit-sync-engine#10 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
apple/sample-cloudkit-sync-engine#6 · 3 个 reaction ·
查看 apple/sample-cloudkit-sync-engine 的全部 Issue
相似的 Issue
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 70/100
harf-promo/decaffeinate#21 ·
-
enhancement low-priority milestone-qa tests
难度 2/5 1-3 小时 新手友好度 66/100
lognorman20/monaco#4877 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
enhancement P3 Starter Task users requested
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复