Repository navigation
fix: keep a shortcut that works again, and a cache file's attributes - #3232
Merged
Merged
Conversation
Delete selected removed the shortcuts on the scan's list after checking only that each file was still there. The list lives for the session and its rows arrive ticked, so a shortcut that worked again by the delete, its program installed again or its document put back, was deleted anyway, permanently without the Recycle Bin. The scan's judgement of a shortcut is now one method, and the delete makes it again for each ticked shortcut: one that works again is kept, taken off the list and counted on the status line, and one the shell can no longer read is left where it is. Rebuild icon and thumbnail cache set each cache file's attributes to Normal before deleting it, which replaces the whole set, so a file Explorer still held stayed on disk without its Hidden and System flags. It clears only ReadOnly now, as Deep Cleanup does, and an architecture test fails a build that sets attributes to Normal anywhere in the app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two deletes that acted on what they had seen earlier instead of what is there now.
What changes
DeleteShortcutschecked only that the.lnkwas still there. The tab keeps the scan's list for the whole session and its rows arrive ticked, so a shortcut that worked again by the time of the delete, its program installed again and the shortcut rewritten at the same path, or a Recent item whose document was put back, was deleted anyway, permanently when Move to Recycle Bin was not ticked, after a confirmation that still called it broken. The scan's judgement of one shortcut is nowJudgeShortcut, which both the scan and the delete use, OneDrive-shared folders included. A shortcut that works again is kept and returned inShortcutDeletion.WorkAgain; the tab takes it off the list and adds "1 works again and was kept." to the status line. A shortcut the shell can no longer read is not shown to be broken and is left.ExplorerShell.DeleteCacheFilesset each file toFileAttributes.Normalbefore deleting it, which replaces the whole set, so a database Explorer still held stayed on disk without Hidden and System. It clears only ReadOnly now, the attribute that blocks a delete, the way Deep Cleanup has since fix: one directory walk for every service that deletes what it finds #2382.ArchitectureTests.NoFileAttributesAreClearedBySettingThemToNormalreads the app's sources with comments stripped, first shows its pattern catches both theSetAttributesand theAttributes =forms, and fails on any use.How it was checked
DeleteShortcuts,AShortcutThatWorksAgain_IsKept_AndSaidToWorkAgainfailed; with theCOMExceptionarm narrowed so it no longer catches,AShortcutTheShellCannotReadAgain_IsKeptfailed. The existing delete tests now hand in a judgement that keeps every shortcut broken and still pass unchanged otherwise.ShortcutCleanerRecheckTests.AShortcutWhoseProgramIsBackBeforeTheDelete_IsKept(integration) writes a real shortcut with the shell to a program in its own temp folder, scans it as broken, creates the program, and deletes: with the production re-check replaced by "always broken" it failed, the shortcut deleted.FileAttributes.Normalback inDeleteCacheFiles,DeleteCacheFiles_AFileItCannotDelete_KeepsItsAttributesand the architecture test both failed.