-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow empty directory values in FileSystemEventArgs/RenamedEventArgs ctors #68582
Allow empty directory values in FileSystemEventArgs/RenamedEventArgs ctors #68582
Conversation
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsFixes #68566. A regression was introduced by #63051. That PR introduced an intentional breaking change where This change allows empty directory values while still resulting in fully-qualified paths for
|
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @jeffhandley thank you for both fixing the issue and improving the tests!
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a style suggestion, but LGTM, thanks.
Fixes #68566.
A regression was introduced by #63051. That PR introduced an intentional breaking change where
FileSystemEventArgs.FullPath
would become a fully-qualified path, but the change also included an unintentional breaking change that preventedFileSystemEventArgs
andRenamedEventArgs
from accepting a directory value that is null or whitespace. That PR added asserts for the empty directory case, ensuring exceptions were thrown, but in .NET 6, the behavior of the event args types was to infer a relative directory in that scenario.This change allows empty directory values while still resulting in fully-qualified paths for
FullPath
andOldFullPath
.