-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: support sync data between different device #1525
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
👍 @arvinxx Thank you for raising your pull request and contributing to our Community |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1525 +/- ##
==========================================
- Coverage 92.57% 91.06% -1.52%
==========================================
Files 239 235 -4
Lines 13066 13091 +25
Branches 1562 1545 -17
==========================================
- Hits 12096 11921 -175
- Misses 970 1170 +200 ☔ View full report in Codecov by Sentry. |
1 数据库基础操作,需要触发 sync 变更逻辑。 需要抽取基础方法并重构现有实现逻辑 2 监听 ymap 对象变更,触发db 变更,需要考虑优化成bulk操作 3 当第一次建联时,需要已有节点向刚建联节点广播现有的数据。 问题: 多个节点第一次达成同步状态后,后续新的节点进入时,新节点没有触发新的「synced」 动作。(非常怀疑是这个问题:yjs/y-webrtc#19 (comment) 经验:多个 YJS Map 的 set 行为,可以用事务存成一个变更 问题: 在 y-websocket 中,我们可以与后端/全局事实来源同步。但是,当只有客户端(或根本没有客户端)时,我们什么时候应该发出 sync?当没有中央真相来源时,我们什么时候才能真正与全球状态同步?
问题:似乎没有办法在 WebRTC 模块里感知到信令服务器的连接成功与否?yjs/y-webrtc#49 有,在 [{
"_observers": {},
"url": "wss://y-webrtc-eu.fly.dev",
"ws": {},
"binaryType": null,
"connected": false,
"connecting": true,
"unsuccessfulReconnects": 0,
"lastMessageReceived": 0,
"shouldConnect": true,
"_checkInterval": 480,
"providers": {}
}] |
1 Basic database operations need to trigger sync change logic. Need to extract basic methods and reconstruct existing implementation logic |
❤️ Great PR @arvinxx ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
## [Version 0.141.0](v0.140.1...v0.141.0) <sup>Released on **2024-03-22**</sup> #### ✨ Features - **misc**: Using YJS and WebRTC to support sync data between different devices. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Using YJS and WebRTC to support sync data between different devices, closes [#1525](#1525) ([60d9186](60d9186)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 0.141.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.21.0](v1.20.1...v1.21.0) <sup>Released on **2024-03-22**</sup> #### ✨ Features - **misc**: Add gemini 1.5 pro support, using YJS and WebRTC to support sync data between different devices. #### 🐛 Bug Fixes - **misc**: Fix code block display issue, hide unnecessary models, rename. #### 💄 Styles - **misc**: add Moonshot Kimi Reverse model to Moonshot model provider., The bottom safe area height of iOS. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Add gemini 1.5 pro support, closes [lobehub#1669](https://github.com/bentwnghk/lobe-chat/issues/1669) ([2b280af](2b280af)) * **misc**: Using YJS and WebRTC to support sync data between different devices, closes [lobehub#1525](https://github.com/bentwnghk/lobe-chat/issues/1525) ([60d9186](60d9186)) #### What's fixed * **misc**: Fix code block display issue, closes [lobehub#1675](https://github.com/bentwnghk/lobe-chat/issues/1675) ([7707dda](7707dda)) * **misc**: Hide unnecessary models ([da9f947](da9f947)) * **misc**: Rename ([49d77ee](49d77ee)) #### Styles * **misc**: add Moonshot Kimi Reverse model to Moonshot model provider., closes [lobehub#1659](https://github.com/bentwnghk/lobe-chat/issues/1659) ([5bae263](5bae263)) * **misc**: The bottom safe area height of iOS, closes [lobehub#1637](https://github.com/bentwnghk/lobe-chat/issues/1637) [lobehub#1181](https://github.com/bentwnghk/lobe-chat/issues/1181) ([44fae5e](44fae5e)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
…evices (lobehub#1525) * ✨ feat: support sync with webrtc * 🎨 chore: improve code * 🎨 chore: improve code * 🐛 fix: fix dont sync when a node enter first * ✨ feat: support webrtc config settings * ✨ feat: add device info card * ✨ feat: finish sync settings * ✨ feat: finish sync settings page * ♻️ refactor: refactor the db to support yjs sync * 🐛 fix: disconnect when user disable sync * ♻️ refactor: refactor the console with debug * 🚸 style: add experiment feature tag * 📱 style: fix with mobile * 🌐 chore: add i18n * 💄 style: improve random name action * 🚸 style: add default Device Name * 🚸 style: add mobile experiment tag * 🚨 ci: fix lint
## [Version 0.141.0](lobehub/lobe-chat@v0.140.1...v0.141.0) <sup>Released on **2024-03-22**</sup> #### ✨ Features - **misc**: Using YJS and WebRTC to support sync data between different devices. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Using YJS and WebRTC to support sync data between different devices, closes [lobehub#1525](lobehub#1525) ([60d9186](lobehub@60d9186)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
## [Version 0.141.0](lobehub/lobe-chat@v0.140.1...v0.141.0) <sup>Released on **2024-03-22**</sup> #### ✨ Features - **misc**: Using YJS and WebRTC to support sync data between different devices. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Using YJS and WebRTC to support sync data between different devices, closes [#1525](lobehub/lobe-chat#1525) ([60d9186](lobehub/lobe-chat@60d9186)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information
RFC: #368