Commit Graph

3 Commits

Author SHA1 Message Date
saladday
70504714f0 Keep WebDAV sync from propagating local proxy state
WebDAV sync now separates portable provider strategy from device-local
proxy state in the smallest upstream-shaped way we could keep coherent.
The backup layer scrubs and restores only the local proxy fields in
proxy_config, while backend restore now rejects when takeover artifacts
or running proxy state are still active.

The command layer was kept thin by routing proxy-setting writes back
through ProxyService, so the same-process restore/mutation boundary has
one owner instead of scattered command-side patches.

Constraint: Must stay upstream-friendly for a large open source codebase without introducing repo-specific multi-process machinery
Constraint: WebDAV restore must not clobber device-local proxy bindings or takeover state
Rejected: Exclude proxy_config from sync entirely | would also stop syncing portable proxy strategy fields
Rejected: Port local cross-process lock and managed-child bootstrap bypass | too local-repo-specific for upstream
Confidence: high
Scope-risk: moderate
Directive: Future writes to device-local proxy fields should continue to flow through ProxyService so the restore boundary remains coherent
Tested: cargo fmt --manifest-path src-tauri/Cargo.toml --check
Tested: cargo check --manifest-path src-tauri/Cargo.toml
Tested: cargo test --manifest-path src-tauri/Cargo.toml sync_import_preserves_local_proxy_config_local_fields -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml sync_export_scrubs_proxy_config_local_fields_but_keeps_strategy_fields -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml has_restore_blocking_proxy_state_is_true_when_live_backup_exists_without_enabled_flag -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml has_restore_blocking_proxy_state_is_true_when_live_config_residue_exists_without_enabled_flag -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml ensure_restore_allowed_rejects_takeover_artifacts_even_when_enabled_flag_is_false -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml proxy_config_update_waits_for_restore_mutation_guard -- --nocapture
Tested: cargo test --manifest-path src-tauri/Cargo.toml start_with_takeover_waits_for_restore_mutation_guard -- --nocapture
Not-tested: Full upstream cargo test suite
Related: SaladDay/cc-switch-cli#111
2026-04-17 15:58:04 +08:00
SaladDay
20f62bf4f8 feat(webdav): follow-up 补齐自动同步与大文件防护 (#1043)
* feat(webdav): add robust auto sync with failure feedback

(cherry picked from commit bb6760124a62a964b36902c004e173534910728f)

* fix(webdav): enforce bounded download and extraction size

(cherry picked from commit 7777d6ec2b9bba07c8bbba9b04fe3ea6b15e0e79)

* fix(webdav): only show auto-sync callout for auto-source errors

* refactor(webdav): remove services->commands auto-sync dependency
2026-02-15 20:58:17 +08:00
clx
6098fa7536 Webdav (#923)
* feat: WebDAV backup/restore

- Add WebDAV test/backup/restore commands and settings\n- Fix ja i18n missing keys; decode PROPFIND href as UTF-8\n- Stabilize Windows prompt auto-import tests via CC_SWITCH_TEST_HOME

* chore: format and minor cleanups

* fix: update build config

* feat(webdav): unify sync UX and hardening fixes

* fix(webdav): harden sync flow and stabilize sync UX/tests

* fix(webdav): add resource limits to skills.zip extraction

Prevent zip bomb / resource exhaustion by enforcing:
- MAX_EXTRACT_ENTRIES (10,000 files)
- MAX_EXTRACT_BYTES (512 MB cumulative)

* refactor(webdav): drop deviceId and display deviceName only

---------

Co-authored-by: small-lovely-cat <77799160+small-lovely-cat@users.noreply.github.com>
Co-authored-by: saladday <1203511142@qq.com>
2026-02-14 15:24:24 +08:00