From c3e2557743a00d4cae3745e4ddcd18f68f75e9ad Mon Sep 17 00:00:00 2001 From: nardoor <102725206+nardoor@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:48:56 +0100 Subject: [PATCH] feat(async): use `is_async_compatible()` to determine backend incompatibility and error out (#1355) Use `getters` to early exit webdav when using `async_incompatible` backends. Using the type system or fixing all async compatibility issue is big and structural work. To avoid runtime crash for our users I suggest using this getter as a temporary fix. tracking issue: https://github.com/rustic-rs/rustic/issues/1181 (see for more details) > As far as I could tell, `webdav` feature was the only one spawning a `runtime` in `rustic` and using it. ### Before merging this one: - [x] rustic_core (core and backend) must be updated to a release that includes rustic-rs/rustic_core#355. --------- Co-authored-by: simonsan <14062932+simonsan@users.noreply.github.com> --- src/commands/webdav.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/webdav.rs b/src/commands/webdav.rs index 5dfdc4ccd..1b3a65f5d 100644 --- a/src/commands/webdav.rs +++ b/src/commands/webdav.rs @@ -81,6 +81,11 @@ impl WebDavCmd { fn inner_run(&self, repo: CliIndexedRepo) -> Result<()> { let config = RUSTIC_APP.config(); + // webdav only works with async compatible repo + if !repo.is_async_compatible() { + return Err(anyhow!("Webdav is currently incompatible with the backend you are using. See https://github.com/rustic-rs/rustic/issues/1181 for more details.")); + } + let path_template = config .webdav .path_template