Skip to content

Add manual and automatic WebDAV cloud data synchronization#145

Merged
RoderickQiu merged 10 commits into
RoderickQiu:masterfrom
XimingZheng:master
Apr 17, 2026
Merged

Add manual and automatic WebDAV cloud data synchronization#145
RoderickQiu merged 10 commits into
RoderickQiu:masterfrom
XimingZheng:master

Conversation

@XimingZheng
Copy link
Copy Markdown
Contributor

This pull request adds a comprehensive WebDAV sync feature, including core logic, UI integration, and extensive localization for English, Simplified Chinese, and Traditional Chinese. It also introduces a new validation checklist for WebDAV sync, enhances the app’s exit/relaunch flow to ensure data consistency, and improves the custom dialog to support sync-related user flows.

WebDAV Sync Integration

  • Added a new WebDAV sync service and integrated it into the main process (main.js), including startup sync, guarded app exit/relaunch, and error handling. [1] [2] [3] [4] [5] [6] [7]
  • Created a detailed validation checklist and manual test log for WebDAV sync in WEB_DAV_SYNC_VALIDATION_STATUS.md.

UI/UX Improvements

  • Enhanced the custom dialog (custom-dialog.html) to support new sync-related flows, including a spinner, detail messages, and custom button/keyboard logic for exit-sync scenarios. [1] [2] [3]

Localization

  • Added and updated all WebDAV sync-related strings in English (locales/en.json), Simplified Chinese (locales/zh-CN.json), and Traditional Chinese (locales/zh-TW.json). [1] [2] [3] [4]

Configuration

  • Updated .yarnrc.yml to set compressionLevel: mixed and disable the global cache, possibly to improve dependency management for the new feature.

These changes together enable robust, user-friendly, and localized manual and automatic WebDAV sync for core app data.

Copilot AI review requested due to automatic review settings April 12, 2026 13:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a full WebDAV-based cloud sync feature (manual + automatic) for core app data, including UI entry points, localized strings, and guarded exit/relaunch behavior to improve data consistency.

Changes:

  • Introduces a new main-process WebDAV sync service with startup pull, auto-push watchers, IPC APIs, and guarded exit flows.
  • Adds preferences UI for configuring/testing WebDAV and triggering manual upload/download, plus enhanced custom dialog support for exit-sync prompts.
  • Adds WebDAV sync localization (en/zh-CN/zh-TW), a manual validation checklist doc, and initial unit tests for core sync helpers.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
webdav-sync.js Implements WebDAV sync coordinator, remote read/write logic, auto-push watchers, IPC, and exit-guard flow
main.js Integrates the WebDAV sync service into app lifecycle (startup sync, guarded quit/relaunch, dialog plumbing)
preferences-renderer.js Adds WebDAV sync configuration UI and manual sync actions; shows runtime sync status/details
custom-dialog.html Extends dialog renderer to support exit-sync UX (spinner, detail text, action routing)
locales/en.json Adds WebDAV sync UI/error/exit-flow strings (English)
locales/zh-CN.json Adds WebDAV sync UI/error/exit-flow strings (Simplified Chinese)
locales/zh-TW.json Adds WebDAV sync UI/error/exit-flow strings (Traditional Chinese)
WEB_DAV_SYNC_VALIDATION_STATUS.md Adds manual validation checklist and current status notes
test/webdav-sync.test.js Adds unit tests for key sync helper behaviors
package.json Pins package manager metadata (Yarn 4)
.yarnrc.yml Adjusts Yarn settings (compression/global cache)
.gitignore Ignores .omx

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webdav-sync.js Outdated
Comment thread webdav-sync.js Outdated
Comment thread main.js Outdated
Comment thread main.js Outdated
Comment thread WEB_DAV_SYNC_VALIDATION_STATUS.md Outdated
Comment thread test/webdav-sync.test.js Outdated
@RoderickQiu
Copy link
Copy Markdown
Owner

Thanks for your contributions! To make it mergeable, you may first review what Copilot has indicated. Meanwhile, WEB_DAV_SYNC_VALIDATION_STATUS.md‎ seems like a temporary file, and does not need to be committed? And we currently does not have automatic tests going on, so you may as well alter the test scripts to either make it fully functioning, or delete that part.

@RoderickQiu RoderickQiu linked an issue Apr 13, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webdav-sync.js
Comment thread webdav-sync.js
Comment thread webdav-sync.js
Comment thread webdav-sync.js
Comment thread main.js Outdated
Comment thread preferences-renderer.js Outdated
Comment thread preferences-renderer.js
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (2)

main.js:504

  • theThemeHasChanged() sends darkModeChanges to win.webContents, but the main window hasn’t loaded index.html yet (createWindow(false)), so the renderer listeners in supporter.js won’t be registered and the message can be dropped. To avoid the initial theme getting out of sync, trigger theme sync after win.loadFile('index.html') finishes (e.g., in did-finish-load) or re-send the event after loadMainWindowAfterStartupInit().
    await webDavSyncService.initialize();
    webDavSyncService.registerIpcHandlers();

    theThemeHasChanged();
    nativeTheme.on('updated', theThemeHasChanged);

main.js:1638

  • appendWebDavSyncLog() is called on every statisticsWriter() invocation, which can be frequent during normal operation. Since the WebDAV service (and logging) is initialized even when WebDAV isn’t configured, this can create unnecessary disk writes and unbounded log growth for users who never enable sync. Consider gating these high-frequency logs behind a config flag (e.g., only when WebDAV is configured / test mode enabled) or making logging opt-in / rotating.
function statisticsWriter() {
    appendWebDavSyncLog('statistics-writer-begin', 'isTimerWin=' + isTimerWin + ', isPositiveTiming=' + isPositiveTiming + ', isOnlyRest=' + isOnlyRest + ', isWorkMode=' + isWorkMode);
    statisticsInitializer();

    if (isTimerWin) {
        if (isOnlyRest) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread main.js Outdated
Comment thread main.js
Comment thread preferences-renderer.js
Comment thread preferences-renderer.js
Comment thread webdav-sync.js
Comment thread webdav-sync.js
Comment thread custom-dialog.html
Comment thread package.json Outdated
XimingZheng and others added 3 commits April 13, 2026 21:02
@RoderickQiu
Copy link
Copy Markdown
Owner

RoderickQiu commented Apr 14, 2026

Some UI suggestions:

  1. As you have already added webdav, then this translation needs to be changed to indicate that webdav syncing is also inside that part.
image
  1. A ":" mark is missing for the title.
image
  1. Look this UI for multiple inputs in one small section, and do not use the big paddings between lines:
image
  1. When I click upload and download from webdav with actually nothing included, I was still getting this:
image image

But the better UX will be that I cannot click them before everything was filled in.

  1. For Remote folder path, I suggest that you provide some more information regarding what is it or what can be filled. Try providing either a placeholder, or a message indicating its usage in the whole part's description.

I believe these are all simple AI-able tasks that will be optimized in seconds.

@RoderickQiu
Copy link
Copy Markdown
Owner

RoderickQiu commented Apr 14, 2026

Moreover, since I actually do not have multiple devices to actually do the syncing test (to make sure it can really sync through devices, and to see how it will be working), it will be the best if you can make that test, and report to me that this is actually working.

@RoderickQiu RoderickQiu merged commit 9c1546f into RoderickQiu:master Apr 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

能否添加同步功能

3 participants