Skip to content

Long-path delete-to-recycle-bin still breaks in ShellDeleteFile

Summary

The bug is fixed and merged to main.

ShellDeleteFile() now keeps LongPathSeams as the existence/direct-delete boundary and uses IFileOperation for recycle-bin deletes instead of SHFileOperation plus a fixed MAX_PATH scratch buffer.

Affected Flows

ShellDeleteFile() is used from live UI delete flows including:

  • srchybrid/DownloadListCtrl.cpp for part-file removal
  • srchybrid/SharedFilesCtrl.cpp
  • srchybrid/SharedDirsTreeCtrl.cpp
  • srchybrid/CollectionCreateDialog.cpp

These were the user-visible flows at risk before the fix.

Landed Fix Shape

  • srchybrid/OtherFunctions.cpp uses IFileOperation for recycle-bin deletes
  • the fixed MAX_PATH + 1 buffer and SHFileOperation path are removed from this flow
  • extended-length path prefix stripping for shell parsing is now delegated to the shared PathHelpers layer instead of ad hoc local helper logic
  • emulebb-build-tests includes deterministic seam coverage for:
  • recycle-bin-enabled deep Unicode delete routing
  • recycle-bin-disabled direct delete routing

Remaining Work

  • keep the regression slice in CI-008
  • optionally add more caller-level delete-flow coverage if later stabilization work needs it

Relationship To Existing Items

  • FEAT-010 tracks the broader long-path shell/UI follow-up.
  • BUG-022 is the concrete highest-risk correctness gap confirmed by the 2026-04-12 community diff review and should be treated as the first hardening slice inside that area.