- Removed the last_sync_at field from the device model and related structures, as it is now superseded by per-peer watermark tracking in sync.db.
- Updated various components, including device registration, sync setup, and messaging protocols, to eliminate references to last_sync_at.
- Introduced a migration to drop the obsolete last_sync_at column from the devices table.
- Adjusted tests and helper functions to reflect the removal of last_sync_at, ensuring they align with the new sync architecture.
- Added new fields for device OS, hardware model, CPU details, memory, and storage specifications to the device registration process.
- Updated the LibraryManager to handle the new device attributes during device creation and updates.
- Modified the sync setup action to include full device information when registering devices with remote peers.
- Enhanced the messaging protocol to support the transmission of detailed hardware specs during device registration.
- Introduced a new test for transitive sync backfill to validate the complete sync process across multiple devices.
- Updated device versioning to use the `updated_at` timestamp for conflict resolution.
- Refactored sync methods to support shared changes with HLC-based conflict resolution.
- Implemented automatic device discovery via shared sync, allowing devices to propagate changes to all members in the library.
- Added migration to transition existing devices to shared sync.
- Enhanced documentation to reflect changes in device ownership and sync methods.
- Introduced new event types for proxy pairing confirmation and vouching readiness in the event summarization.
- Implemented a reload mechanism for protocol configurations to support dynamic updates during runtime.
- Enhanced the PairingProtocolHandler to manage joiner pairing handshakes and improve session handling.
- Added comprehensive unit tests for proxy pairing, covering session creation, state transitions, and vouching logic.
- Updated configuration structures to include default proxy pairing settings for better integration.
This commit enhances the BackfillManager by collecting successfully applied UUIDs during the backfill process and emitting batch resource events for UI reactivity. It also updates the protocol handler to emit resource events for insert and update changes, ensuring that the UI reflects the latest state. Additionally, a new test is added to verify that volume ResourceChanged events are emitted correctly during synchronization, improving the overall synchronization experience.
This commit introduces improvements to the synchronization process by adding foreign key conversion to UUIDs for cross-device compatibility. It also implements batch syncing of mime types before content identities to ensure proper dependency resolution. Additionally, the content identity model is updated to include mime type and kind ID handling, enhancing data integrity during sync operations. Debugging information is added to track registered models and their sync types, improving traceability in the sync process.
This commit enhances the ephemeral indexing process by introducing batch processing for entries, which reduces lock contention and improves performance. It also adds a new parameter to control event emissions based on the indexing context (volume indexing vs. directory browsing). Additionally, the progress reporting mechanism is updated to reflect actual file counts, ensuring more accurate completion metrics during indexing operations. These changes optimize the overall efficiency and user experience of the indexing system.
This commit improves the `CopyJobDetails` component by adding an auto-scroll feature that centers the currently copying file in the transfer queue. Additionally, it implements a mechanism to refetch copy metadata when the completed file count changes, ensuring that the displayed information is always up-to-date. The UI is further refined with updated icons and styles for better user experience during file operations.
This commit introduces a new `CopyJobDetails` component to display detailed information about file copy jobs, including transfer speed, estimated time of arrival (ETA), and a speed graph. The `JobCard` and `JobList` components are updated to support this new functionality, allowing users to view historical speed data for ongoing jobs. Additionally, the `useJobs` hook is enhanced to manage speed history, ensuring a smooth user experience during file operations. These changes improve the overall visibility and feedback for users managing file transfers.
This commit introduces several improvements to the file copy functionality, including the addition of metadata for rich UI display during copy operations. It implements detailed tracking of file counts and total bytes, enhancing user feedback during the process. Additionally, a new mechanism for checking and resolving file conflicts has been added, allowing for better handling of existing files at the destination. The changes also include the introduction of a `CopyJobMetadata` structure to facilitate querying of copy job details, improving the overall robustness and user experience of file operations.
This commit updates the LocationManager to ensure that all locations have a resolved volume before creation. It simplifies volume ID handling by removing lazy resolution and directly returning errors when volumes are not found. Additionally, it modifies related functions to reflect these changes, enhancing the robustness of volume management in the application.
This commit updates the dependencies in the Cargo.toml files for both sd-tauri-core and src-tauri, removing the deprecated sd-core dependency and adding the dirs crate for platform-specific directory handling. Additionally, it modifies the implementation of data directory resolution in sd-tauri-core to support different operating systems. The Cargo.lock file is also updated to reflect these changes.
This commit updates the CONTRIBUTING.md file to provide clearer instructions on building the project with media processing features. It introduces convenient cargo aliases for building with `ffmpeg` and `heif` features enabled, and emphasizes the importance of these features for development. Additionally, it includes notes on the implications of building without these features and how to resolve related issues. The changes aim to improve the onboarding experience for new contributors.
This commit updates the application structure by replacing the Explorer component with the new Shell component in both the Tauri and web applications. The Shell component serves as the main entry point, enhancing the overall architecture and layout management. Additionally, the interface documentation has been updated to reflect this change, ensuring clarity in the component hierarchy.
This commit adds core shutdown logic to multiple test scenarios in the `file_copy_pull_test.rs` and `volume_tracking_test.rs` files. The shutdown ensures that file descriptors are released after test completion, improving resource management and preventing potential leaks. This change enhances the reliability of the tests by ensuring a clean state after execution.
This commit updates the VSCode settings to include new configurations for newline handling and formatting. In the Cargo.toml file for the server, the default features have been cleared to streamline dependencies. Additionally, the TagsGroup and TagSelector components have been modified to handle both TagSearchResult and raw Tag objects, improving tag extraction and selection logic. These changes enhance the overall development experience and ensure better tag management in the application.
This commit introduces a `release` method to the `LibraryLock` struct, allowing for explicit lock release during library shutdown. The `_lock` field in the `Library` struct is now wrapped in a `Mutex<Option<LibraryLock>>` to facilitate this change. Additionally, the shutdown process has been updated to ensure the lock is released properly, even with lingering references. The library test has been adjusted to reflect a change from "thumbnails" to "sidecars" in the expected directory structure.
Resolved conflict in core/src/infra/sync/hlc.rs by adopting the main branch's
improved test implementation that properly uses FakeTimeSource for deterministic
time control in tests.
- Removed the static ASCII logo and implemented a new function to calculate brightness on a sphere, allowing for a dynamic rendering of the Spacedrive logo as a purple orb using ANSI colors and Unicode half-blocks.
- Enhanced the `print_logo_colored` function to utilize the new brightness calculation and color gradient, improving visual representation.
- Updated related documentation to reflect the changes in logo rendering.
- Updated debug print statements in the indexing test to use consistent formatting with multi-line syntax for improved readability.
- Rearranged test suite definitions in `test_core.rs` for better organization and clarity, including renaming test cases for consistency.
- Added new test cases to cover additional functionalities, ensuring comprehensive test coverage.
These changes aim to improve the clarity of debug information and the overall structure of the test suite.
- Reduced sleep duration after shutdown to 500ms to expedite test execution while still allowing time for SQLite file locks to release.
- Enhanced uniqueness of temporary directory names on Windows by incorporating a timestamp alongside a counter, preventing conflicts with leftover files from previous runs.
- Implemented retry logic for cleaning up leftover directories on Windows, improving robustness against file lock issues during test execution.
These changes aim to enhance the reliability and performance of tests in a Windows environment.
- Added device_id parameter to DatabaseAdapter and DatabaseAdapterForJob for improved context handling.
- Updated ChangeDetector to utilize device_id when creating persistence instances, ensuring accurate indexing behavior.
- Refactored related tests to verify correct parent-child relationships and prevent duplicate entries during folder moves.
- Normalize file paths to use forward slashes in Git pattern matching for better compatibility across platforms.
- Introduce a random suffix to temporary directory names in tests on Windows to avoid file lock contention during parallel execution.
- Add a delay after shutdown in tests to ensure SQLite file locks are released properly on Windows.
These changes aim to improve the reliability and consistency of tests in a Windows environment.
- Fix flaky HLC test by handling timing variations between sequential calls
- Move GENERIC_READ import to correct module in Windows file operations
- Add debug logging to change detection test for troubleshooting
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
- Updated the fixture generation process to write to a temporary directory by default, improving test isolation and following best practices.
- Added instructions for regenerating source fixtures when needed, enhancing developer experience.
- Refactored the test suite structure to utilize a more flexible argument handling mechanism, allowing for easier addition of new tests.
- Removed deprecated test configurations and streamlined the test suite definitions for clarity and maintainability.
- Introduced TestDataDir for managing test data directories with automatic cleanup and optional snapshot support, ensuring all test data is created in the system temp directory.
- Added SnapshotManager to facilitate capturing snapshots of test state for post-mortem debugging, with platform-specific storage locations.
- Updated various integration tests to utilize the new TestDataDir structure, enhancing consistency and determinism in test execution.
- Revised documentation to reflect new conventions for test data management and snapshot usage.
- Modified test data paths in various integration tests to use the Spacedrive source code instead of user directories, ensuring consistent and deterministic test results across environments.
- Updated comments and documentation to reflect the new testing approach and clarify the purpose of using project source code for testing.
- Enhanced the GitHub Actions workflow to skip Rust toolchain setup on macOS self-hosted runners, assuming Rust is pre-installed.
Refactored the environment variable retrieval logic for Windows to enhance clarity by adding additional line breaks. This change maintains the existing functionality while making the code easier to read and understand.
- Changed get_all_allowed_paths() to async to properly await library manager operations
- Changed is_path_allowed() to async and fixed RwLock held across await points
- Changed validate_path_access() to async for consistency
- Replaced blocking_read() and block_on() with proper async/await
- Clone RwLock data before await to ensure future is Send
- Updated all call sites to use .await
- Improved error logging with structured tracing
This fixes compilation errors where futures were not Send due to
RwLockReadGuard being held across await points, and prevents potential
deadlocks from blocking operations in async contexts.
Fixes the file_transfer_test which now passes successfully.
Implements Windows File ID support in the indexer to enable stable file
identification across renames on Windows NTFS filesystems. This brings
Windows to feature parity with Unix/Linux/macOS for change detection
and UUID persistence.
**Problem:**
Previously, Windows files didn't have stable identifiers across renames
because get_inode() returned None. This meant:
- Renamed files were treated as delete + create
- UUIDs were not preserved across renames
- Tags, metadata, and relationships were lost
- Files had to be re-indexed and re-hashed unnecessarily
**Solution:**
Uses Windows NTFS File IDs (64-bit file index) via GetFileInformationByHandle
API as the equivalent of Unix inodes for stable file identification.
**Changes:**
- Added windows-sys dependency for Win32 File System API access
- Implemented get_inode() for Windows using GetFileInformationByHandle
- Combines nFileIndexHigh and nFileIndexLow into 64-bit identifier
- Gracefully handles FAT32/exFAT (returns None) and permission errors
- Updated all call sites to pass both path and metadata parameters
- Updated test harness to verify Windows File ID tracking
**Benefits:**
- File renames now detected as moves (not delete + create)
- UUIDs preserved across renames within a volume
- Tags and metadata preserved across renames
- No re-indexing or re-hashing needed for renamed files
**Limitations:**
- Only works on NTFS (FAT32/exFAT fall back to path-only matching)
- File IDs are volume-specific (cross-volume copies get new UUIDs)
Addresses task CORE-015
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Extends the FileCopyJob to support PULL operations, enabling files to be
copied FROM remote devices TO the local device. Previously, only PUSH
operations worked (local -> remote).
Changes:
- Add PullRequest/PullResponse messages to FileTransferMessage enum
- Add TransferDirection enum to detect PUSH vs PULL operations
- Refactor RemoteTransferStrategy to detect direction automatically
- Implement execute_pull() for remote source -> local destination
- Add handle_pull_request() handler on the protocol side
- Add path validation for security (prevent directory traversal)
- Add integration test for PULL operations
The strategy automatically detects direction based on SdPath:
- Source is local + Destination is remote = PUSH (existing behavior)
- Source is remote + Destination is local = PULL (new behavior)
This enables users to drag files from remote device explorers to local
folders, which previously failed with 'Source must be local path' error.
Closes FILE-005
- Updated `stream_file_data` to bypass encryption, as Iroh provides end-to-end encryption for connections.
- Adjusted `FileTransferProtocolHandler` to skip decryption, directly using the received encrypted data.
- Enhanced logging to reflect changes in data handling during file transfers.
- Added tests to ensure session keys are distinct and validate key swapping functionality.
- Improved error handling in `DevicePersistence` for corrupted session keys during device loading.
- Updated documentation for copy strategies to clarify their use cases and selection logic.
- Improved logging in `DevicePersistence` to track loading of paired devices and handle expired session keys.
- Added detailed logging for session key retrieval in `FileTransferProtocolHandler`.
- Introduced a new test for file transfer with daemon restart to ensure session key persistence across restarts.
- Updated macOS subproject reference to indicate a dirty state.
- Refactored `FileCopyJob` to improve logging for final destination calculations.
- Enhanced `stream_file_data` logging to include destination path in transfer requests.
- Added `find_containing` method to `EphemeralIndex` for substring search functionality.
- Improved logging in `ephemeral_search` to track search results and filtering.
- Replaced print statements with tracing logs in `FileTransferProtocolHandler` for better debugging.
- Added `DirectoryPreview` component for rendering a grid view of subdirectories in the Quick Preview.
- Updated `ContentRenderer` to utilize `DirectoryPreview` for directory types.
- Introduced TypeScript integration test for verifying cache updates upon file deletions, ensuring accurate directory listing after deletions.
- Enhanced keyboard handling in Explorer to prevent shortcuts when input fields are focused.
- Added `run_in_background` field to `IndexerJobConfig` to allow jobs to run without persisting to the database or updating the UI.
- Updated `should_persist` method in `IndexerJob` to account for background jobs.
- Modified `handle_new_directory` in `DatabaseAdapter` to create background indexer jobs.
- Ensured default value for `run_in_background` is set to false in various configurations.
- Introduced a new integration test for bulk file moves to validate cache updates and file handling.
- Added a new test suite in `core/tests/typescript_bridge_test.rs` to facilitate end-to-end testing between Rust and TypeScript.
- Introduced `IndexingHarnessBuilder` enhancements to support a daemon RPC server for TypeScript tests.
- Created TypeScript test files for `useNormalizedQuery` to validate file move and folder rename operations.
- Configured Bun test environment with `bunfig.toml` and setup scripts for improved testing efficiency.
- Updated `TcpSocketTransport` to handle TCP connections for the TypeScript client, ensuring robust communication with the Rust backend.
- Enhanced logging and error handling for better visibility during test execution.
- Added a new function `validate_and_reset_library_if_needed` to check if the current library exists and reset the state if it doesn't.
- Integrated this validation process into the daemon connection initialization, ensuring the app state is consistent with the available libraries.
- Enhanced error handling and logging for better debugging during library validation.
- Introduced a new test suite for file move operations, covering various scenarios to ensure robust handling of file movements and state integrity.
- Introduced a new test suite for validating the tag workflow, including tag creation, application, and database persistence.
- Implemented event collection to verify resource events during tag operations.
- Added assertions to ensure correct tag associations with files and proper database entries.
- Enhanced logging for better traceability of test execution and outcomes.
- Refactored the `IndexPersistence` implementation to improve error handling and logging when querying directory paths.
- Updated the change detection logic to always load existing entries during reindexing, ensuring accurate detection of moves, modifications, and deletions.
- Introduced a new test suite for folder rename operations, covering both persistent and ephemeral indexing scenarios, validating UUID/inode preservation and parent-child relationship integrity.
- Enhanced the `IndexingHarnessBuilder` to allow disabling the filesystem watcher for specific tests, improving test flexibility.
- Added closure table integrity verification to ensure proper connections between renamed folders and their children, preventing data inconsistencies.
- Introduced a new `IndexMode::Stale` variant to enhance the indexing process by leveraging modified time (mtime) pruning.
- Updated `IndexerJobConfig` to utilize the new mode, allowing for more efficient directory exploration based on filesystem changes.
- Implemented logic in the discovery phase to skip directories with matching mtime, improving performance and reducing unnecessary indexing.
- Enhanced `IndexMode` with helper methods to check for mtime pruning and retrieve the inner indexing mode.
- Updated relevant functions and tests to support the new stale detection capabilities, ensuring robust handling of file indexing and statistics tracking.
- Refactored existing code to accommodate the new indexing strategy while maintaining backward compatibility with previous modes.
- Updated the TODO list to clarify the quick preview reporting issue.
- Enhanced the Tauri app's menu to include custom clipboard operations (cut, copy, paste) with appropriate state management.
- Introduced a new `statistics_listener` service to manage per-library statistics recalculation based on resource changes, improving performance and responsiveness.
- Added configuration options for enabling/disabling the statistics listener in the application settings.
- Refactored event handling in the job manager to improve logging and status monitoring.
- Updated tests to include the new statistics listener functionality and ensure proper event collection during file operations.