- Sanitize remote filename to prevent path traversal attacks
- Distinguish EOF vs actual errors when reading from stream
- Fail transfer on byte count mismatch instead of just logging
- Validate transfer_completed after loop to catch interrupted transfers
- Warn when checksum verification enabled but no checksum provided
- Remove redundant contains('..') check after canonicalize()
- Update comments for clarity
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 `FileByIdQuery` and `FileByPathQuery` to populate alternate paths for files with the same content ID, improving data retrieval for file instances.
- Introduced `get_alternate_paths` method in both queries to fetch alternate file paths from the database.
- Modified the `InstancesTab` component to utilize a new query for alternate instances, enhancing the user interface with detailed instance information.
- Updated TypeScript types to support the new alternate instances query structure, ensuring type safety across the application.
- Adjusted various components to improve the display of alternate file instances, including device and path information.
- Added a new `files` field to `FileSearchOutput` to provide a flat array of files, improving integration with the explorer.
- Updated the `FileSearchQuery` to join directory paths directly on `parent_id`, simplifying the SQL query.
- Enhanced the query to batch fetch sidecars for content UUIDs, improving performance and data retrieval.
- Adjusted the handling of content identity fields to ensure proper association with files in search results.
- Updated the `SearchView` component to utilize the new `files` array instead of the previous `results` structure.
- Introduced a new column `device_id` in the entries table to denormalize device relationships, improving query performance.
- Updated related models and queries to accommodate the new device_id field.
- Enhanced foreign key mappings and migration scripts to support the addition of device_id.
- Adjusted various components to handle device_id, ensuring compatibility across the application.
- Improved release workflow to include specific file types for distribution.
- 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.
- Adjusted indentation for clarity in the `search_ephemeral_index` function.
- Ensured consistent formatting for the filter application section to enhance code readability.
- Replaced the previous event processing loop with a select-based approach to handle both incoming events and periodic eviction ticks.
- Ensured that expired pending removes are processed even when no new events arrive.
- Improved efficiency by reducing busy waiting during event collection.
- 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.
Implements comprehensive search functionality that intelligently routes between
ephemeral (in-memory) and persistent (FTS5 database) indexes, following the
directory listing pattern for consistency.
**Backend Changes:**
- Add IndexType enum (Persistent/Ephemeral/Hybrid) to communicate which index was used
- Add FilterKind enum to indicate available filters for each search type
- Implement ephemeral_search module with content type filtering via FileTypeRegistry
- Update FileSearchOutput with index_type and available_filters fields
- Add routing logic in FileSearchQuery to determine and use appropriate index
- Support file type, size, date, and content type filters in ephemeral search
**Frontend Changes:**
- Add search mode to Explorer context (browse vs search with query/scope)
- Create SearchView component with placeholder for search results
- Wire up SearchBar with debounced search (300ms, min 2 chars)
- Integrate search mode switching in ExplorerView router
**Key Features:**
- Fast, synchronous search (no events, no jobs)
- Defaults to current folder scope (not global like Finder)
- Backend as source of truth for all search operations
- Content type filtering using FileTypeRegistry.identify_by_extension()
- Ephemeral search supports: file types, size, dates, content types
- Persistent search supports: all ephemeral filters + tags + locations
**Architecture:**
Follows the directory listing pattern: checks location index mode, queries
database, falls back to ephemeral cache. Search results indicate which index
was used and which filters are available for dynamic UI updates.
- Marked several tasks as completed in the TODO list, including opening files with the default app, drag selection area functionality, and initializing the startup screen for Core/daemon.
- Added `run_in_background` field to ThumbnailPolicy to control background execution behavior.
Resolved conflicts in:
- SelectionContext.tsx: Merged rename state with isActiveTab prop
- useFileContextMenu.ts: Combined rename/folder actions with Open With submenu
- FileCard.tsx: Integrated InlineNameEdit with useOpenWith hook
- TableRow.tsx: Integrated InlineNameEdit with useOpenWith hook
- Updated ThumbnailJobConfig to include `run_in_background` field, allowing jobs to run without persisting to the database or updating the UI.
- Modified IndexerJob to inherit the background flag from its configuration.
- Implemented `should_persist` method in ThumbnailJob to determine persistence based on the background execution flag.
- 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.
- Replaced synchronous job completion handling with an asynchronous background task to improve responsiveness.
- Extracted job output handling and stats saving into the background task, allowing for better event-driven processing.
- Updated the `save_volume_stats` method to be static and adjusted the output structure to reflect the new indexing approach.
- 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.
- Added critical tasks for remote file access and updater functionality to the TODO list.
- Updated job logging configuration to include an option for logging ephemeral jobs, improving logging flexibility.
- Enhanced the job manager to conditionally log job events based on persistence settings, ensuring better tracking of job statuses.
- Refactored the inspector component to remove unnecessary console logs, streamlining the codebase.
- Improved the selection context to eliminate redundant logging during file synchronization, enhancing performance.
- 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.
- Introduced a new `useClipboard` hook for managing clipboard operations, including copy and cut functionalities.
- Updated file context menu to utilize the clipboard for copy and cut actions, improving user experience.
- Enhanced file operation modal to handle paste operations using clipboard contents, streamlining file management.
- Refactored keyboard navigation in the Explorer component to support clipboard actions, ensuring intuitive user interactions.
- Improved job management by adding sound notifications specific to job types, enhancing feedback during file operations.
- Replaced `eprintln!` with `tracing::warn!` for logging job cancellation, pause, and resume errors, improving logging consistency and integration with the tracing framework.
- Updated the `useJobs` hook to handle job pause, resume, and cancel actions with improved error handling, ensuring better user feedback on job status.
- Enhanced the UI components to reflect changes in job management, including better error reporting for failed actions.
- Added `remove_from_library` field to `DeviceRevokeInput` and `DeviceRevokeAction` to control whether a device should be removed from library databases during revocation.
- Updated the `from_input` method in `DeviceRevokeAction` to handle the new field.
- Modified the revocation logic to conditionally remove devices from libraries based on the `remove_from_library` flag, improving flexibility in device management.
- Adjusted the CLI argument parsing to default `remove_from_library` to false, ensuring devices remain in libraries unless explicitly specified for removal.
- Replaced useState with useReducer in the Explorer context for improved state management.
- Updated navigation functions to use navigateToPath instead of setCurrentPath, enhancing clarity and consistency.
- Removed unused synchronization functions for URL parameters, streamlining the code.
- Introduced new utility functions for target management and improved type definitions for navigation targets.
- Enhanced the handling of view settings and preferences, ensuring better integration with the UI state.
- Deleted obsolete device operation test file to clean up the codebase.
- Added `remove_paired_device_from_cache` method to `DeviceManager` for removing unpaired devices from the cache.
- Enhanced `DeviceRevokeAction` to handle device revocation, including detailed logging for each step of the removal process from network registry, persistence, and DeviceManager cache.
- Updated `DevicePersistence` to ensure proper deletion of device keys from KeyManager and improved logging for device removal.
- Refactored `DeviceRegistry` to clean up node-to-device and session mappings upon device removal.
- Introduced integration tests to verify the complete lifecycle of device operations, ensuring unpaired devices are correctly removed from all caches and persistent storage.
- Added cancel job functionality to the job management system, allowing users to cancel running or paused jobs.
- Updated job-related components (`JobRow`, `JobCard`, `JobList`) to include cancel action buttons, improving user interaction.
- Integrated sound notifications for job completion, enhancing user feedback upon job status changes.
- Refactored `useJobs` hook to manage job cancellation and sound playback, ensuring a cohesive experience across job management features.
- Improved sidebar navigation by implementing `setSpaceItemIdFromSidebar` for better context handling during navigation events.
- Introduced a new `JobsScreen` component to manage and display job statuses, allowing users to view running, paused, queued, completed, and failed jobs.
- Updated job data structures to include `created_at` and `started_at` timestamps, improving job tracking and reporting.
- Refactored job-related components to utilize the new data structure, ensuring consistency across the application.
- Enhanced the `JobRow` component to display job duration and status more effectively, improving user experience.
- Added filtering options for job visibility, allowing users to toggle between viewing all jobs or only active ones.
- Updated the SpaceItem component to improve the handling of custom onClick and context menu behaviors, allowing for more flexible interactions.
- Introduced new hooks for managing drop zones, enabling better support for file insertion and move-into operations.
- Simplified the logic for determining active states and resolved metadata for space items, enhancing overall performance and maintainability.
- Added utility functions for item metadata resolution and drop target identification, streamlining the component's functionality.
- Improved styling and structure for insertion indicators and drop highlights, ensuring a more intuitive user experience.
- Introduced a new command `ResetCache` in the `IndexCmd` enum to allow users to reset the ephemeral index cache.
- Implemented `EphemeralCacheResetAction` to handle the cache reset logic, including confirmation checks and logging.
- Added input and output structures for the cache reset action, providing clear feedback on the number of cleared paths.
- Enhanced the `EphemeralIndexCache` with a `clear_all` method to facilitate the clearing of all cached paths and entries.
- Added support for emitting `JobStarted` events for persistent and resumed jobs in the `JobManager`, improving event tracking.
- Updated `IndexerJobConfig` to filter hidden files by default for ephemeral browsing, aligning with typical file browser behavior.
- Refined button styles in `JobManagerPopover` and `SyncMonitorPopover` to remove hover effects for a more consistent user experience.
- Improved context menu handling in `SpaceItem` to support custom behavior, enhancing flexibility for virtual items.
- Adjusted styling in `SpacesSidebar` to ensure consistent cursor behavior across buttons.
- Added a new `LibraryLoadFailed` event to capture and report errors when loading libraries, including error type categorization for frontend notifications.
- Introduced a method to count `.sdlibrary` directories without loading them, improving the library initialization process.
- Updated the library manager to emit the new event upon load failures, enhancing error handling and user feedback.
- Enhanced logging to provide better insights during library loading and initialization.
- Introduced a new function to determine the appropriate icon for sidecar files based on their format and kind, enhancing visual representation.
- Updated the FileInspector component to utilize the new icon logic, replacing static image components with dynamic icon rendering.
- Cleaned up unused code related to icon display, improving overall component readability and maintainability.
- Added event emission for resource deletion in `DeviceRevokeAction` to improve resource management.
- Refactored `MediaView` to calculate item size dynamically based on available space, enhancing layout responsiveness.
- Updated context menu handling in `DevicesGroup` to support device unpairing, improving user interaction.
- Introduced optional `onContextMenu` prop in `SpaceItem` for customizable context menu behavior.
- Added tests to verify UUID preservation during reindexing and file modifications in `indexing_test.rs`.
- Updated `Inspector` and `ExplorerProvider` to handle virtual files and views, ensuring consistent navigation and state management.
- Introduced `VirtualPathBar` and `VolumeSizeBar` components for improved UI representation of virtual views and volume sizes.
- Refactored `PathBar` and `FileCard` components to integrate new virtual file handling logic, enhancing user experience in the Explorer interface.
- Updated `ResourceManager` to improve handling of virtual resource dependencies, adding debug logging for better traceability.
- Introduced a new `FileKinds` item type in the `ItemType` enum to categorize file types (images, videos, audio, etc.).
- Enhanced the `LibraryManager` to create space-level items, including the new `FileKinds` category.
- Implemented virtual resource event emissions in `DeleteGroupAction` and `DeleteItemAction` to ensure proper resource management during deletions.
- Added a new `SpaceCustomizationPanel` for managing space groups and items, allowing users to customize their workspace effectively.
- Updated various UI components to support drag-and-drop functionality for palette items and improved context menu interactions for group management.
- Added a new `file_count` column to the `content_kinds` table to track the number of content identities for each kind, improving statistics calculation efficiency.
- Implemented a migration script to add the `file_count` column and ensure backward compatibility.
- Updated the `Library` struct to include a method for updating content kind counts based on existing content identities.
- Introduced a new query for retrieving content kind statistics, including file counts, to facilitate better data analysis and reporting.
- Refactored related components to support the new statistics functionality, enhancing overall data integrity and performance.
- Added logging for Gaussian splat job creation in `GenerateSplatAction`.
- Updated `ContentRenderer` to include new state management for MeshViewer controls, improving user interaction with Gaussian splats.
- Introduced `MeshViewerUI` component for enhanced control over Gaussian splat visualization, including auto-rotate and sway settings.
- Improved `GaussianSplatViewer` to handle loading states and camera animations more effectively.
- Refactored `MeshViewer` to integrate new control props and manage state changes for Gaussian splat rendering.
- Introduced a new `GaussianSplat` variant in the `JobOutput` enum to handle output from Gaussian splat jobs.
- Implemented `GenerateSplatAction` for initiating Gaussian splat generation, including input and output structures.
- Created `GaussianSplatJob` and its associated processing logic for batch image processing and splat generation.
- Added `GaussianSplatProcessor` to manage the processing of images into 3D Gaussian splats.
- Updated the media module to include new splat-related functionalities and integrated them into the existing workflow.
- Enhanced the interface components to support visualization and interaction with Gaussian splats, including a toggle for displaying splat overlays.
- Updated TypeScript types to accommodate new splat generation inputs and outputs, ensuring type safety across the application.