[Feature]: Support Multi-device Data Sync (Between Desktops, Desktop and Mobile)
This issue was translated automatically.
Issue Checklist
- I understand that issues are for reporting problems and requesting features, not for off-topic comments, and I will provide as much detail as possible to help resolve the issue.
- I have checked the pinned issues and searched through the existing open issues, closed issues, and discussions and did not find a similar suggestion.
- Found related requirements, see linked issues below; this issue is used to track multi-device sync delivery under the reference solution.
- I have provided a short and descriptive title so that developers can quickly understand the issue when browsing the issue list, rather than vague titles like "A suggestion" or "Stuck."
- The latest version of Cherry Studio does not include the feature I am suggesting.
- This issue is for version planning requirements, full feature verification has not been performed on the latest released version.
Platform
Windows / macOS / Linux; sync scope covers both desktop and mobile.
Version
Target version: v2.4.0 (feature planning, current version not specified).
Is your feature request related to an existing issue?
When users switch between multiple computers or between computers and phones, they need to maintain consistent chat and related business data, and be able to resume syncing after offline use. The following two core scenarios need to be supported:
- Desktop ↔ Desktop: Two-way sync between multiple computers.
- Desktop ↔ Mobile: Two-way sync between computers and phones.
Related requirements: #14898, #12934, #19377. See #18590 for LAN transfer related requirements.
Desired Solution
Provide local-first multi-device data sync for the same user: each device retains an offline-capable data copy, and automatically syncs additions, modifications, and deletions after connecting to the network, eventually converging.
Data Scope (per reference solution, confirm table-by-table and field-by-field whitelist before implementation)
- Conversations, messages, assistants, groups, prompts, tags.
- Non-sensitive configurations for Provider / Model, and whitelisted preference settings.
- Managed files, chat attachments; knowledge base syncs metadata and source files, vectors and full-text indexes are rebuilt locally.
- Stream messages sync after reaching terminal state, not uploaded token by token.
- First version excludes API Keys, OAuth Tokens, bot keys, Cache, BootConfig, app_state, task runtime state and resume tokens; local paths and external file references remain device-local. AI Usage Records to be evaluated later.
Sync Behavior and Data Protection
- Create a recoverable local backup before first-time enablement, provide merge preview, data volume estimation and cancellation option to avoid silently overwriting existing data.
- Support incremental sync, offline catch-up, failure retry and restart recovery; duplicate requests do not create duplicate records.
- Handle conflicts for concurrent modifications by data type; message content cannot be silently overwritten, conflict copies are preserved when safe merging is not possible.
- Deletions propagate across devices and support recovery per defined retention policy.
- Desktop and mobile reuse the same sync protocol; mobile supports catch-up after returning to foreground and on-demand attachment download.
- Capable of account isolation and device revocation; encryption, key recovery and rotation schemes to be clarified during design phase.
Reference Technical Direction (pending design review)
Adopt CloudKit-style sync layer as described in the document: local SQLite working copy, Go sync service, record versioning and persistent change log; implement sync via Push / Pull and cursors, real-time notifications only prompt for pull. Do not sync the entire SQLite file. Client business writes are atomically committed with outbox, remote change applications avoid re-transmission.
Acceptance Criteria
- Additions, modifications, and deletions between multiple desktop devices can be two-way synced and eventually consistent.
- Additions, modifications, and deletions between desktop and mobile can be two-way synced and eventually consistent.
- After offline modifications, notification loss, network interruption, retry and client restart, data can be caught up without duplicate records.
- Concurrent editing and delete/modify conflicts will not silently lose user content.
- First-time sync protects existing data on both ends, can be cancelled and restored from backup.
- Attachment upload can resume after interruption, sensitive credentials and device-local state are not included in first version sync data.
- Verify cross-account isolation, device revocation and cross-version compatibility behavior.
- Verify large-volume batch initialization and UI response per reference solution; online change notification within 1 second, data convergence within 5 seconds as targets to be confirmed via stress testing.
Alternative Solutions
- Manual backup/restore or full database overwrite can be used for migration, but cannot meet the requirements for multi-device concurrent modification, incremental merging and automatic recovery.
- LAN Transfer can handle point-to-point file transfer, but does not handle cross-device data consistency responsibility.
Additional Information
Reference document: Cherry Studio Multi-device Data Sync Service Plan (read version: revision 4).
Target milestone: v2.4.0, the delivery scope of this issue includes sync between desktops and between desktop and mobile.
Complete sync protocol ADR, data sync scope checklist and E2EE/device recovery threat model review before implementation. Account system, end-to-end encryption implementation scope, deletion retention period and cross-device semantics of current conversation branches still need to be clarified; recommended values and workload estimates in the reference document are not confirmed commitments.
Original Content
Issue Checklist
- I understand that issues are for reporting problems and requesting features, not for off-topic comments, and I will provide as much detail as possible to help resolve the issue.
- I have checked the pinned issues and searched through the existing open issues, closed issues, and discussions and did not find a similar suggestion.
- 已检索到相关需求,见下方关联 issue;本 issue 用于跟踪参考方案下的多端同步交付。
- I have provided a short and descriptive title so that developers can quickly understand the issue when browsing the issue list, rather than vague titles like "A suggestion" or "Stuck."
- The latest version of Cherry Studio does not include the feature I am suggesting.
- 本 issue 为版本规划需求,未对最新发布版本进行完整功能核验。
Platform
Windows / macOS / Linux;同步范围同时覆盖桌面端与移动端。
Version
目标版本:v2.4.0(功能规划,未指定当前使用版本)。
Is your feature request related to an existing issue?
用户在多台电脑以及电脑与手机之间切换时,需要保持聊天和相关业务数据一致,并能在离线使用后恢复同步。需要支持以下两个核心场景:
- 桌面 ↔ 桌面:多台电脑之间双向同步。
- 桌面 ↔ 移动端:电脑与手机之间双向同步。
相关需求:#14898、#12934、#19377。局域网传输相关需求见 #18590。
Desired Solution
为同一用户提供本地优先的多端数据同步:各端保留可离线使用的数据副本,联网后自动同步增改删并最终收敛。
数据范围(按参考方案,实施前确认逐表、逐字段白名单)
- 会话、消息、助手、分组、提示词、标签。
- Provider / Model 的非敏感配置,以及白名单内的偏好设置。
- 托管文件、聊天附件;知识库同步元数据和源文件,向量及全文索引在本地重建。
- 流式消息进入终态后同步,不逐 token 上传。
- 首版排除 API Key、OAuth Token、机器人密钥、Cache、BootConfig、app_state、任务运行态和 resume token;本地路径及外部文件引用保持设备本地。AI Usage Records 后续评估。
同步行为与数据保护
- 首次启用前创建可恢复的本地备份,提供合并预览、数据量估算及取消入口,避免无提示覆盖已有数据。
- 支持增量同步、断线补拉、失败重试及重启恢复;重复请求不产生重复记录。
- 并发修改按数据类型处理冲突;消息正文不能静默覆盖,无法安全合并时保留冲突副本。
- 删除跨设备传播,并按确定的保留策略支持恢复。
- 桌面与移动端复用同一同步协议;移动端支持回到前台后补拉及附件按需下载。
- 具备账户隔离和设备撤销能力;加密、密钥恢复及轮换方案在设计阶段明确。
参考技术方向(待设计评审)
采用文档中的 CloudKit 风格同步层:本地 SQLite 工作副本、Go 同步服务、记录版本和持久化变更日志;以 Push / Pull 和游标实现同步,实时通知仅提示拉取。不同步整个 SQLite 文件。客户端业务写入与 outbox 原子提交,远端变更应用避免再次回传。
验收标准
- 多台桌面设备之间的新增、修改、删除能够双向同步并最终一致。
- 桌面与移动端之间的新增、修改、删除能够双向同步并最终一致。
- 离线修改、通知丢失、网络中断、重试及客户端重启后,可补齐数据且无重复记录。
- 并发编辑与删除/修改冲突不会静默丢失用户内容。
- 首次同步保护两端已有数据,可取消并从备份恢复。
- 附件上传中断后可恢复,敏感凭证及设备本地状态不进入首版同步数据。
- 验证跨账户隔离、设备撤销和跨版本兼容行为。
- 按参考方案验证大数据量分批初始化与 UI 响应;在线变化提示 1 秒、数据收敛 5 秒作为待压测确认的目标。
Alternative Solutions
- 手动备份/恢复或整库覆盖可用于迁移,但无法满足多端并发修改、增量合并和自动恢复的需求。
- LAN Transfer 可承担点对点文件传输,不承担跨设备数据一致性职责。
Additional Information
参考文档:Cherry Studio 多端数据同步服务计划方案(读取版本:revision 4)。
目标 milestone:v2.4.0,本 issue 的交付范围包含桌面之间和桌面与移动端同步。
实施前完成同步协议 ADR、数据同步范围清单及 E2EE/设备恢复威胁模型评审。账号体系、端到端加密落地范围、删除保留期和当前会话分支的跨端语义仍需明确;参考文档中的推荐值与工作量估算不作为已确认承诺。
Source: CherryHQ/cherry-studio