[PR #5019] [MERGED] fix(desktop): disk space detection #5023

Closed
opened 2026-03-17 02:30:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5019
Author: @CuriousCorrelation
Created: 4/24/2025
Status: Merged
Merged: 4/25/2025
Merged by: @AndrewBastin

Base: nextHead: fix-desktop-du-units


📝 Commits (1)

  • 4b139bf fix(desktop): disk space detection

📊 Changes

7 files changed (+287 additions, -120 deletions)

View changed files

📝 packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/Cargo.lock (+88 -14)
📝 packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/Cargo.toml (+1 -1)
📝 packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/error.rs (+3 -0)
📝 packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/layout.rs (+1 -1)
📝 packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/manager.rs (+22 -6)
📝 packages/hoppscotch-desktop/src-tauri/Cargo.lock (+101 -27)
📝 pnpm-lock.yaml (+71 -71)

📄 Description

Appload fails to load with a "Storage full" error despite having sufficient disk space. This was caused by a unit mismatch assumption where the sys-info crate returns disk space in kilobytes instead of previously assumed bytes.

This PR replace sys-info v0.9.1 with the more actively maintained sysinfo 0.34.2 which does return size of the disk in bytes.

Expected Before After
fix-desktop-du-expected fix-desktop-du-before fix-desktop-du-after

Closes #5017
Closes HFE-831

Rebased on #5010, consider merging that first.

Issues:

What's changed

  • Replace sys-info v0.9.1 with sysinfo 0.34.2 which return size of the disk in bytes.
  • Rewrite the ensure_space function to find the correct disk of the config dir
  • Add a new StorageError::DiskNotFound for cases where the disk cannot be resolved

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5019 **Author:** [@CuriousCorrelation](https://github.com/CuriousCorrelation) **Created:** 4/24/2025 **Status:** ✅ Merged **Merged:** 4/25/2025 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `next` ← **Head:** `fix-desktop-du-units` --- ### 📝 Commits (1) - [`4b139bf`](https://github.com/hoppscotch/hoppscotch/commit/4b139bfe95d39c37ec46a7ab12ac3c9d9d98c420) fix(desktop): disk space detection ### 📊 Changes **7 files changed** (+287 additions, -120 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/Cargo.lock` (+88 -14) 📝 `packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/Cargo.toml` (+1 -1) 📝 `packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/error.rs` (+3 -0) 📝 `packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/layout.rs` (+1 -1) 📝 `packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-appload/src/storage/manager.rs` (+22 -6) 📝 `packages/hoppscotch-desktop/src-tauri/Cargo.lock` (+101 -27) 📝 `pnpm-lock.yaml` (+71 -71) </details> ### 📄 Description Appload fails to load with a "Storage full" error despite having sufficient disk space. This was caused by a unit mismatch assumption where the `sys-info` crate returns disk space in kilobytes instead of previously assumed bytes. This PR replace `sys-info v0.9.1` with the more actively maintained `sysinfo 0.34.2` which does return size of the disk in bytes. | Expected | Before | After | | --- | --- | --- | | <img width="425" alt="fix-desktop-du-expected" src="https://github.com/user-attachments/assets/8a084ee7-70d0-4595-957d-d70242ee3a77" /> | <img width="1510" alt="fix-desktop-du-before" src="https://github.com/user-attachments/assets/c28d6cfd-a119-4fbb-8727-ca27b1e77b49" /> | <img width="1510" alt="fix-desktop-du-after" src="https://github.com/user-attachments/assets/8dd39fd3-cf4b-4681-b51a-d5fe759d9b50" /> Closes #5017 Closes HFE-831 Rebased on #5010, consider merging that first. Issues: - sys_info::disk_info() returns values in KB, see: https://github.com/FillZpp/sys-info-rs/blob/60ecf1470a5b7c90242f429934a3bacb6023ec4d/c/linux.c#L119 - The `StorageFull` error was triggered when comparing raw bytes against a KB value, causing false positive ### What's changed - Replace `sys-info v0.9.1` with `sysinfo 0.34.2` which return size of the disk in bytes. - Rewrite the `ensure_space` function to find the correct disk of the config dir - Add a new `StorageError::DiskNotFound` for cases where the disk cannot be resolved --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:30:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5023
No description provided.