Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix(desktop): disk space detection on overlay fs (#5226)

Shreyas39124fb50d47
diff --git a/packages/hoppscotch-common/package.json b/packages/hoppscotch-common/package.json
index 4d3b661dc..f634b5c29 100644
--- a/packages/hoppscotch-common/package.json
+++ b/packages/hoppscotch-common/package.json
@@ -39,7 +39,7 @@
"@hoppscotch/httpsnippet": "3.0.9",
"@hoppscotch/js-sandbox": "workspace:^",
"@hoppscotch/kernel": "workspace:^",
- "@hoppscotch/plugin-appload": "github:CuriousCorrelation/tauri-plugin-appload#0308b55e82f7f01d878a7fdf0f597d1dc975f2ce",
+ "@hoppscotch/plugin-appload": "github:CuriousCorrelation/tauri-plugin-appload#1b52e49d881926135838cf6cfebdc1643a9bec31",
"@hoppscotch/ui": "0.2.5",
"@hoppscotch/vue-toasted": "0.1.0",
"@lezer/highlight": "1.2.0",
diff --git a/packages/hoppscotch-desktop/package.json b/packages/hoppscotch-desktop/package.json
index af7fa2103..ff395f33e 100644
--- a/packages/hoppscotch-desktop/package.json
+++ b/packages/hoppscotch-desktop/package.json
@@ -16,7 +16,7 @@
"@fontsource-variable/material-symbols-rounded": "5.1.3",
"@fontsource-variable/roboto-mono": "5.1.0",
"@hoppscotch/kernel": "workspace:^",
- "@hoppscotch/plugin-appload": "github:CuriousCorrelation/tauri-plugin-appload#0308b55e82f7f01d878a7fdf0f597d1dc975f2ce",
+ "@hoppscotch/plugin-appload": "github:CuriousCorrelation/tauri-plugin-appload#1b52e49d881926135838cf6cfebdc1643a9bec31",
"@hoppscotch/ui": "0.2.1",
"@tauri-apps/api": "2.1.1",
"@tauri-apps/plugin-process": "2.2.0",
diff --git a/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/LICENSE.md b/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/LICENSE.md
index 24bfc7fe1..2b0b5d59d 100644
--- a/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/LICENSE.md
+++ b/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/LICENSE.md
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024 - CuriousCorrelation
+Copyright (c) 2025 - CuriousCorrelation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/README.md b/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/README.md
index 2b069f78a..11fb364a7 100644
--- a/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/README.md
+++ b/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/README.md
@@ -100,6 +100,6 @@ Requirements:
## License
-Code: (c) 2024 - CuriousCorrelation
+Code: (c) 2025 - CuriousCorrelation
MIT or MIT/Apache 2.0 where applicable.
diff --git a/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/lib.rs b/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/lib.rs
index 5bc6b2a85..06eef7605 100644
--- a/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/lib.rs
+++ b/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/lib.rs
@@ -1,4 +1,4 @@
-// Copyright 2024 CuriousCorrelation
+// Copyright 2025 CuriousCorrelation
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
diff --git a/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/manager.rs b/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/manager.rs
index 962da9bc9..e7b993915 100644
--- a/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/manager.rs
+++ b/packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/manager.rs
@@ -153,26 +153,32 @@ impl StorageManager {
StorageError::Io(e)
})?;
+ // Convert both paths to the same format for comparison, Windows...
+ let normalized_storage = dunce::canonicalize(&storage_path).unwrap_or(storage_path.clone());
+
// NOTE: There cannot be more than one user config storage disk,
// although even if there is, defaulting to the first one we found
// is as good of a guess as any.
- let disk = disks.into_iter().find(|disk| {
- // Convert both paths to the same format for comparison, Windows...
- let normalized_storage =
- dunce::canonicalize(&storage_path).unwrap_or(storage_path.clone());
- let normalized_disk = dunce::canonicalize(disk.mount_point())
- .unwrap_or_else(|_| disk.mount_point().to_path_buf());
-
- normalized_storage.starts_with(&normalized_disk)
- });
-
- let Some(disk) = disk else {
- tracing::error!(
- storage_path = %storage_path.display(),
- "Fatal error, unable to resolve user config storage disk"
- );
- return Err(StorageError::DiskNotFound);
- };
+ // Find the disk with the longest matching mount point
+ let disk = disks
+ .into_iter()
+ .filter_map(|disk| {
+ let normalized_disk = dunce::canonicalize(disk.mount_point())
+ .unwrap_or_else(|_| disk.mount_point().to_path_buf());
+
+ normalized_storage
+ .starts_with(&normalized_disk)
+ .then_some((disk, normalized_disk))
+ })
+ .max_by_key(|(_, normalized_disk)| normalized_disk.as_os_str().len())
+ .map(|(disk, _)| disk)
+ .ok_or_else(|| {
+ tracing::error!(
+ storage_path = %storage_path.display(),
+ "Fatal error, unable to resolve user config storage disk"
+ );
+ StorageError::DiskNotFound
+ })?;
let available = disk.available_space();
diff --git a/packages/hoppscotch-desktop/src-tauri/Cargo.lock b/packages/hoppscotch-desktop/src-tauri/Cargo.lock
index a68af1c24..d7434b69b 100644
--- a/packages/hoppscotch-desktop/src-tauri/Cargo.lock
+++ b/packages/hoppscotch-desktop/src-tauri/Cargo.lock
@@ -5038,7 +5038,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-appload"
version = "0.1.0"
-source = "git+https://github.com/CuriousCorrelation/tauri-plugin-appload?rev=0308b55e82f7f01d878a7fdf0f597d1dc975f2ce#0308b55e82f7f01d878a7fdf0f597d1dc975f2ce"
+source = "git+https://github.com/CuriousCorrelation/tauri-plugin-appload?rev=1b52e49d881926135838cf6cfebdc1643a9bec31#1b52e49d881926135838cf6cfebdc1643a9bec31"
dependencies = [
"base64 0.22.1",
"blake3",
diff --git a/packages/hoppscotch-desktop/src-tauri/Cargo.toml b/packages/hoppscotch-desktop/src-tauri/Cargo.toml
index ad74f1457..2f8bf99b9 100644
--- a/packages/hoppscotch-desktop/src-tauri/Cargo.toml
+++ b/packages/hoppscotch-desktop/src-tauri/Cargo.toml
@@ -29,7 +29,7 @@ tauri-plugin-store = "2.2.0"
tauri-plugin-dialog = "2.2.0"
tauri-plugin-fs = "2.2.0"
tauri-plugin-deep-link = "2.2.0"
-tauri-plugin-appload = { git = "https://github.com/CuriousCorrelation/tauri-plugin-appload", rev = "0308b55e82f7f01d878a7fdf0f597d1dc975f2ce" }
+tauri-plugin-appload = { git = "https://github.com/CuriousCorrelation/tauri-plugin-appload", rev = "1b52e49d881926135838cf6cfebdc1643a9bec31" }
tauri-plugin-relay = { git = "https://github.com/CuriousCorrelation/tauri-plugin-relay", rev = "0147ac1bb29d3b88d6652432a482bd86f0174506" }
axum = "0.8.1"
tower-http = { version = "0.6.2", features = ["cors"] }
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 97abc47f8..6050d941f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -525,8 +525,8 @@ importers:
specifier: workspace:^
version: link:../hoppscotch-kernel
'@hoppscotch/plugin-appload':
- specifier: github:CuriousCorrelation/tauri-plugin-appload#0308b55e82f7f01d878a7fdf0f597d1dc975f2ce
- version: '@CuriousCorrelation/plugin-appload@https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/0308b55e82f7f01d878a7fdf0f597d1dc975f2ce'
+ specifier: github:CuriousCorrelation/tauri-plugin-appload#1b52e49d881926135838cf6cfebdc1643a9bec31
+ version: '@CuriousCorrelation/plugin-appload@https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/1b52e49d881926135838cf6cfebdc1643a9bec31'
'@hoppscotch/ui':
specifier: 0.2.5
@@ -998,8 +998,8 @@ importers:
specifier: workspace:^
version: link:../hoppscotch-kernel
'@hoppscotch/plugin-appload':
- specifier: github:CuriousCorrelation/tauri-plugin-appload#0308b55e82f7f01d878a7fdf0f597d1dc975f2ce
- version: '@CuriousCorrelation/plugin-appload@https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/0308b55e82f7f01d878a7fdf0f597d1dc975f2ce'
+ specifier: github:CuriousCorrelation/tauri-plugin-appload#1b52e49d881926135838cf6cfebdc1643a9bec31
+ version: '@CuriousCorrelation/plugin-appload@https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/1b52e49d881926135838cf6cfebdc1643a9bec31'
'@hoppscotch/ui':
specifier: 0.2.1
@@ -1838,8 +1838,8 @@ packages:
graphql:
optional: true
- '@CuriousCorrelation/plugin-appload@https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/0308b55e82f7f01d878a7fdf0f597d1dc975f2ce':
- resolution: {tarball: https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/0308b55e82f7f01d878a7fdf0f597d1dc975f2ce}
+ '@CuriousCorrelation/plugin-appload@https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/1b52e49d881926135838cf6cfebdc1643a9bec31':
+ resolution: {tarball: https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/1b52e49d881926135838cf6cfebdc1643a9bec31}
version: 0.1.0
'@CuriousCorrelation/plugin-relay@https://codeload.github.com/CuriousCorrelation/tauri-plugin-relay/tar.gz/0147ac1bb29d3b88d6652432a482bd86f0174506':
@@ -14528,7 +14528,7 @@ snapshots:
optionalDependencies:
graphql: 16.11.0
- '@CuriousCorrelation/plugin-appload@https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/0308b55e82f7f01d878a7fdf0f597d1dc975f2ce':
+ '@CuriousCorrelation/plugin-appload@https://codeload.github.com/CuriousCorrelation/tauri-plugin-appload/tar.gz/1b52e49d881926135838cf6cfebdc1643a9bec31':
dependencies:
'@tauri-apps/api': 2.1.1