Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-294] Volume awareness #2796

Merged
merged 22 commits into from
Dec 9, 2024
Merged

[ENG-294] Volume awareness #2796

merged 22 commits into from
Dec 9, 2024

Conversation

jamiepine
Copy link
Member

@jamiepine jamiepine commented Nov 1, 2024

Volume awareness

This PR introduces a robust volume management system for Spacedrive, enabling the application to track and interact with storage volumes across different platforms.

Features

  • Cross-platform volume detection for Linux, macOS, and Windows
  • Intelligent handling of platform-specific volume types (e.g., APFS volumes on macOS)
  • Real-time volume monitoring with watchers for mount/unmount events
  • Volume fingerprinting for consistent identification across sessions
  • Speed testing capabilities for volume performance metrics
  • Database integration for persisting volume metadata
  • Event system for volume state changes
  • Support for all major filesystem types (NTFS, FAT32, EXT4, APFS, etc.)

Key Technical Details

  • Actor-based architecture for thread-safe state management
  • Asynchronous operation using Tokio
  • Efficient memory usage with Arc/RwLock for shared state
  • Platform-specific volume detection using sysinfo and native APIs
  • Mount point aggregation for complex volumes (e.g., macOS APFS)
  • Error handling with custom error types and proper propagation
  • Event broadcasting system for real-time updates
  • Integration with Prisma for database operations

Usage Example

// Create volume manager
let ctx = VolumeManagerContext {
    device_id: device_id.into(),
    library_event_tx: libraries.rx.clone(),
};
let (volumes, _actor) = create_volume_manager(ctx).await?;

// List available volumes
let system_volumes = volumes.list_system_volumes().await?;

Copy link

linear bot commented Nov 1, 2024

ENG-294 Volume awareness

Copy link

vercel bot commented Nov 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spacedrive-landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2024 3:38am
spacedrive-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2024 3:38am

@jamiepine jamiepine changed the title [ENG-294] Volume Awareness [ENG-294] Volume awareness Nov 1, 2024
…ce volume API with new types and improve UI handling
…nt processing, and optimizing interaction within the watcher system
…me scanning on startup, and enhance state management
…erprint handling, and improve system volume interactions
…ration, and improve database interaction for system volumes
…n volume management, and improve UI integration for ejecting volumes
@jamiepine jamiepine marked this pull request as ready for review December 9, 2024 03:39
@jamiepine jamiepine requested review from a team as code owners December 9, 2024 03:39
@jamiepine jamiepine merged commit 64ff5b3 into main Dec 9, 2024
6 of 13 checks passed
@jamiepine jamiepine deleted the eng-294-volume-awareness branch December 9, 2024 23:22
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.

1 participant