MyMacCleaner icon indicating copy to clipboard operation
MyMacCleaner copied to clipboard

BUG: Lists

Open bircni opened this issue 10 months ago • 1 comments

When clicking "Deselect all" in a list the app crashes

bircni avatar Jan 30 '26 18:01 bircni

Hi @bircni, thanks for reporting this issue! 🙏

I tried to replicate the crash on my machine by testing "Deselect All" in all the views that have this feature:

  • Home → Smart Scan results
  • Disk Cleaner → Scan results
  • Duplicates → After scanning for duplicates
  • Orphaned Files → After scanning for orphans
  • Browser Privacy → Browser data list

Unfortunately, I wasn't able to reproduce the crash on my end.

To help me investigate further, could you please provide some additional information?

  1. macOS version: Which version of macOS are you running? (e.g., 14.2, 15.0)
  2. Which view: In which specific view did the crash occur? (Home, Disk Cleaner, Duplicates, etc.)
  3. Reproduction steps: What actions did you perform before clicking "Deselect All"?
  4. Crash report: If you have a crash report from Console.app or ~/Library/Logs/DiagnosticReports/, that would be very helpful

In the meantime, I've proactively improved the code to make it more robust:

Changes made:

  • Fixed unsafe ForEach pattern in ScanResultsCard.swift - The view was iterating over sorted indices which could become stale during re-renders
  • Improved array mutation safety - All selectAll/deselectAll/toggleCategorySelection functions now create a copy before mutation to ensure SwiftUI's @Published property wrapper triggers properly and avoids mutation during iteration
  • Fixed force unwrap in FileScanner.swift - Replaced categories.last! with safe optional handling
  • Fixed CGGradient force unwraps in SpaceLensView.swift - Added proper guard statements with fallback rendering
  • Fixed unsafe array access in PerformanceView.swift - Now uses safe first(where:) instead of direct index access

These changes should make the app more stable overall, even if they don't directly fix the issue you encountered.

Thanks again for the report, and looking forward to your additional info!

Prot10 avatar Jan 31 '26 11:01 Prot10