Fix: Fixed issue with stale ADS items after stream delete/move - #18755
Fix: Fixed issue with stale ADS items after stream delete/move#18755yair100 wants to merge 4 commits into
Conversation
|
Doing it In Dev, delete and create refresh correctly, rename cause the new and old name to show Doing it out of Dev, delete doesn't refresh , create does refresh correctly, rename cause the new and old name to show |
|
I can reproduce that as well (renaming shows both old and new revisions before refreshing) |
|
@Lamparter even after the latest fix? |
|
Yes |
|
Renaming doesn't show the old one when doing it the first time but after it show both. Deleting ADS file outside of dev still doesn't refresh |
| if (renamed.PrimaryItemAttribute == StorageItemTypes.File) | ||
| renamed.FileExtension = Path.GetExtension(newPath); | ||
|
|
||
| foreach (var adsItem in filesAndFolders.ToList().OfType<AlternateStreamItem>().Where(x => x.MainStreamPath.Equals(oldPath, StringComparison.OrdinalIgnoreCase))) |
There was a problem hiding this comment.
| foreach (var adsItem in filesAndFolders.ToList().OfType<AlternateStreamItem>().Where(x => x.MainStreamPath.Equals(oldPath, StringComparison.OrdinalIgnoreCase))) | |
| foreach (var adsItem in filesAndFolders.OfType<AlternateStreamItem>().Where(x => x.MainStreamPath.Equals(oldPath, StringComparison.OrdinalIgnoreCase))) |
| case FILE_ACTION_ADDED_STREAM: | ||
| case FILE_ACTION_REMOVED_STREAM: | ||
| case FILE_ACTION_MODIFIED_STREAM: | ||
| case FILE_ACTION_RECHECK_STREAM: |
There was a problem hiding this comment.
(You can add curly braces {} for cases)
| foreach (var adsItem in filesAndFolders.ToList().Where(x => x is AlternateStreamItem ads && ads.MainStreamPath == matchingItem.ItemPath)) | ||
| foreach (var adsItem in filesAndFolders.ToList().Where(x => x is AlternateStreamItem ads && ads.MainStreamPath.Equals(matchingItem.ItemPath, StringComparison.OrdinalIgnoreCase))) |
There was a problem hiding this comment.
| foreach (var adsItem in filesAndFolders.ToList().Where(x => x is AlternateStreamItem ads && ads.MainStreamPath == matchingItem.ItemPath)) | |
| foreach (var adsItem in filesAndFolders.ToList().Where(x => x is AlternateStreamItem ads && ads.MainStreamPath.Equals(matchingItem.ItemPath, StringComparison.OrdinalIgnoreCase))) | |
| foreach (var adsItem in filesAndFolders.ToArray().Where(x => x is AlternateStreamItem ads && ads.MainStreamPath.Equals(matchingItem.ItemPath, StringComparison.OrdinalIgnoreCase))) |
|
|
||
| try | ||
| { | ||
| var items = filesAndFolders.ToList(); |
There was a problem hiding this comment.
| var items = filesAndFolders.ToList(); | |
| var items = filesAndFolders.ToArray(); |
|
Even if the listed issues aren't fixable, this still improves support with ADS |
Resolved / Related Issues
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as
Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.