Skip to content

Progress updates not showing during scan and UI performance degradation with large file counts #3

@jotarios

Description

@jotarios

Description

During volume scanning, progress updates are not showing in the UI after the initial "Starting scan of [Volume]..." message. Additionally, when scanning large hard drives or volumes with many files, the UI becomes unresponsive.

Steps to Reproduce

  1. Start scanning a large external volume with many audio files
  2. Observe the progress message in the sidebar
  3. Notice that it only shows "Starting scan of [Volume]..." and doesn't update
  4. Try to interact with the UI during the scan
  5. Notice the UI is frozen/unresponsive

Expected Behavior

  • Progress updates should show frequently during scanning:
    • Current folder being scanned
    • Number of files found so far
    • Real-time feedback as the scan progresses
  • UI should remain responsive during long-running scans

Current Behavior

  • Only shows "Starting scan of [Volume]..."
  • No further progress updates are visible
  • UI freezes during scan on large volumes
  • User cannot interact with the application while scanning

Technical Details

  • Progress callback is called every 50 files and for each directory
  • Progress updates are wrapped in Task { @MainActor in ... }
  • Scan runs in Task.detached background thread
  • Batch size: 2000 files
  • Related to issue UI freezes during volume scanning #2 (UI freezing during volume scanning)

Files Affected

  • prism/Scanner/FileScanner.swift
  • prism/ViewModels/SearchViewModel.swift
  • prism/Views/SidebarView.swift

Observations

The issue appears to be worse with:

  • Large hard drives (1TB+)
  • High file counts (10,000+ files)
  • Deep directory structures

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions