Skip to content

Fix WebDAV auto sync conflict handling#4006

Open
xwil1 wants to merge 1 commit into
farion1231:mainfrom
xwil1:codex/protect-auto-sync-remote-changes
Open

Fix WebDAV auto sync conflict handling#4006
xwil1 wants to merge 1 commit into
farion1231:mainfrom
xwil1:codex/protect-auto-sync-remote-changes

Conversation

@xwil1

@xwil1 xwil1 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR improves WebDAV auto-sync conflict handling to avoid automatically overwriting remote changes.

Changes

  • Track snapshot IDs and localized error keys in sync status.
  • Add three-way sync state detection for WebDAV auto sync:
    • local-only changes can auto upload
    • remote-only changes pause auto sync and require manual resolution
    • local and remote changes pause auto sync and require manual resolution
    • matching local and remote snapshots refresh sync status without re-uploading
  • Use WebDAV ETag preconditions for automatic uploads to avoid overwriting remote updates during upload.
  • Add a WebDAV conflict dialog that lets users choose between:
    • using the local version to overwrite the cloud
    • using the cloud version to overwrite local data
  • Show clearer auto-sync paused guidance in settings.
  • Add snapshot/error-key tracking and remote manifest checks for S3 auto sync.
  • Add translations for zh/en/zh-TW/ja.
  • Add frontend test coverage for the conflict dialog and auto-sync guidance.

Scope

  • Affects WebDAV/S3 cloud sync only.
  • Manual upload and manual download keep their existing explicit overwrite behavior.
  • Does not affect provider configuration writes, local routing, transformer routing, usage statistics, or session management.

Tests

  • pnpm format:check
  • pnpm typecheck
  • pnpm test:unit
  • pnpm build:renderer
  • cargo fmt --manifest-path src-tauri/Cargo.toml --check
  • git diff --check

@xwil1 xwil1 force-pushed the codex/protect-auto-sync-remote-changes branch from 1c63347 to d290add Compare June 10, 2026 08:07
@farion1231

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d290addfc6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +472 to +473
let Some(base_snapshot_id) = last_synced_snapshot_id(status) else {
return SnapshotSyncState::Conflict;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve legacy manifest baselines for auto-sync

For profiles that synced before this change, the stored status has last_remote_manifest_hash but no last_*_snapshot_id. When those users make a local-only edit after upgrading and the remote manifest is unchanged, last_synced_snapshot_id(status) is None, so this path classifies the safe upload as Conflict and pauses WebDAV auto-sync indefinitely until the user resolves it manually. The S3 guard still falls back to last_remote_manifest_hash, but this WebDAV state assessment ignores that existing baseline; pass/compare the remote manifest hash or migrate the status so upgraded users do not get false conflicts.

Useful? React with 👍 / 👎.

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.

2 participants