NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

[Bug] webdev同步合并覆盖问题

Open EvilMouth opened this issue 1 year ago • 15 comments

Describe the bug 使用webdav同步功能,即使本地修改配置,点击同步,都会被远端配置覆盖,看上去像是 mergeWithUpdate 代码的问题,我尝试修改并解决了覆盖问题 https://github.com/EvilMouth/ChatGPT-Next-Web/commit/fdcc19a24aab23c5d6ee464d9986d9ae155d7e41

To Reproduce Steps to reproduce the behavior:

  1. 前往设置页
  2. 配置好webdav,假设远端已经有一份备份
  3. 修改本地某一项配置,比如发送键从 Meta+Enter 改为 Enter
  4. 点击同步
  5. 出现错误case:远端的配置覆盖本地配置,发送键被覆盖回 Meta+Enter

Expected behavior 本地配置的修改时间比远端新,应该覆盖远端的配置

EvilMouth avatar Dec 19 '23 09:12 EvilMouth

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] webdev synchronization merge coverage problem

Issues-translate-bot avatar Dec 19 '23 09:12 Issues-translate-bot

现在点击同步只会把云端数据覆盖本地数据,如果想上传到云端只能去 webdav 里把云端文件删了。

altair441n avatar Dec 22 '23 06:12 altair441n

Bot detected the issue body's language is not English, translate it automatically.


Clicking sync now will only overwrite the local data with the cloud data. If you want to upload it to the cloud, you can only delete the cloud files in webdav.

Issues-translate-bot avatar Dec 22 '23 06:12 Issues-translate-bot

现在点击同步只会把云端数据覆盖本地数据,如果想上传到云端只能去 webdav 里把云端文件删了。

@altair441n 故意这样设计的?

EvilMouth avatar Dec 22 '23 07:12 EvilMouth

Bot detected the issue body's language is not English, translate it automatically.


Clicking sync now will only overwrite the local data with the cloud data. If you want to upload it to the cloud, you can only delete the cloud files in webdav.

@altair441n Is this intentional?

Issues-translate-bot avatar Dec 22 '23 07:12 Issues-translate-bot

现在点击同步只会把云端数据覆盖本地数据,如果想上传到云端只能去 webdav 里把云端文件删了。

@altair441n 故意这样设计的?

应该是bug,这个问题好多人反馈了,之前的issue里有人提到过这个方法。

altair441n avatar Dec 22 '23 07:12 altair441n

Bot detected the issue body's language is not English, translate it automatically.


Clicking sync now will only overwrite the local data with the cloud data. If you want to upload it to the cloud, you can only delete the cloud files in webdav.

@altair441n Designed this way on purpose?

It should be a bug. Many people have reported this problem. Someone mentioned this method in the previous issue.

Issues-translate-bot avatar Dec 22 '23 07:12 Issues-translate-bot

同步能不能提供成两个选项:1. 同步云端,将本地的数据覆盖掉云端的 2. 同步本地,将云端的数据覆盖掉本地的

Mleon7 avatar Dec 23 '23 06:12 Mleon7

Bot detected the issue body's language is not English, translate it automatically.


Can synchronization be provided with two options: 1. Synchronize with the cloud, overwriting the local data with the cloud; 2. Synchronize with the local, overwrite the local data with the cloud.

Issues-translate-bot avatar Dec 23 '23 06:12 Issues-translate-bot

同样遇到这个问题,本地修改的配置不会上传。而且本地的删除操作也不会同步到云端,只有增加或者修改内容才能同步

Plainct avatar Dec 29 '23 02:12 Plainct

Bot detected the issue body's language is not English, translate it automatically.


I also encountered this problem, the locally modified configuration will not be uploaded. Moreover, local deletion operations will not be synchronized to the cloud. Only adding or modifying content can be synchronized.

Issues-translate-bot avatar Dec 29 '23 02:12 Issues-translate-bot

同步能不能提供成两个选项:1. 同步云端,将本地的数据覆盖掉云端的 2. 同步本地,将云端的数据覆盖掉本地的

我赞同,+1。

Sligcm avatar Jun 03 '24 08:06 Sligcm

Bot detected the issue body's language is not English, translate it automatically.


Can synchronization be provided with two options: 1. Synchronize with the cloud, overwriting the local data with the cloud; 2. Synchronize with the local, overwrite the local data with the cloud

I agree, +1.

Issues-translate-bot avatar Jun 03 '24 08:06 Issues-translate-bot

我也发现了这个问题,看代码的逻辑是,完全合并本地与远端的会话与消息。这样很不友好,导致只要同步到服务端了,就没办法删除了(一同步又回来了)。如果直接删除服务器上文件,不创建也报错。 我这边改造了一版,我还在自测,我现在用都正常。你们可以试试我的版本。支持删除的云同步版本

ahzmr avatar Aug 04 '24 02:08 ahzmr

Bot detected the issue body's language is not English, translate it automatically.


I also discovered this problem. The logic of the code is to completely merge local and remote sessions and messages. This is very unfriendly. As long as it is synchronized to the server, it cannot be deleted (it will come back as soon as it is synchronized). If you delete the file on the server directly, an error will be reported without creating it. I have modified a version here, and I am still testing it myself. Now I can use it normally. You can try my version. Cloud synchronization version that supports deletion

Issues-translate-bot avatar Aug 04 '24 02:08 Issues-translate-bot