Add manual and automatic WebDAV cloud data synchronization#145
Conversation
There was a problem hiding this comment.
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.
|
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()sendsdarkModeChangestowin.webContents, but the main window hasn’t loadedindex.htmlyet (createWindow(false)), so the renderer listeners insupporter.jswon’t be registered and the message can be dropped. To avoid the initial theme getting out of sync, trigger theme sync afterwin.loadFile('index.html')finishes (e.g., indid-finish-load) or re-send the event afterloadMainWindowAfterStartupInit().
await webDavSyncService.initialize();
webDavSyncService.registerIpcHandlers();
theThemeHasChanged();
nativeTheme.on('updated', theThemeHasChanged);
main.js:1638
appendWebDavSyncLog()is called on everystatisticsWriter()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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
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. |





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
main.js), including startup sync, guarded app exit/relaunch, and error handling. [1] [2] [3] [4] [5] [6] [7]WEB_DAV_SYNC_VALIDATION_STATUS.md.UI/UX Improvements
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
locales/en.json), Simplified Chinese (locales/zh-CN.json), and Traditional Chinese (locales/zh-TW.json). [1] [2] [3] [4]Configuration
.yarnrc.ymlto setcompressionLevel: mixedand 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.