Skip to content
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

FileSystemEntry.Unix: ensure properties are available when file is deleted. #60214

Merged
merged 12 commits into from
Nov 18, 2021

Conversation

tmds
Copy link
Member

@tmds tmds commented Oct 9, 2021

When the file no longer exists, we create attributes based on what we know.

The test for this was passing because it cached the attributes before the
item was deleted due to enumerating with skipping FileAttributes.Hidden.

@carlossanlop ptal.

…leted.

When the file no longer exists, we create attributes based on what we know.

The test for this was passing because it cached the attributes before the
item was deleted due to enumerating with skipping FileAttributes.Hidden.
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 9, 2021
@ghost
Copy link

ghost commented Oct 9, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

When the file no longer exists, we create attributes based on what we know.

The test for this was passing because it cached the attributes before the
item was deleted due to enumerating with skipping FileAttributes.Hidden.

@carlossanlop ptal.

Author: tmds
Assignees: -
Labels:

area-System.IO, community-contribution

Milestone: -

@tmds
Copy link
Member Author

tmds commented Oct 9, 2021

I'll extend the tests so it covers more of the changes.

@tmds tmds changed the title FileSystemEntry.Unix: ensure attributes are available when file is deleted. FileSystemEntry.Unix: ensure properties are available when file is deleted. Oct 11, 2021
@tmds
Copy link
Member Author

tmds commented Oct 12, 2021

This is up for review.

@tmds
Copy link
Member Author

tmds commented Oct 26, 2021

@carlossanlop ptal. This fixes a bug in how FileSystemEntry behaves when the underlying entry was deleted. There is a test for this, but it inadvertently captured the properties up-front due to the default EnumerationOptions checking to skip FileAttributes.Hidden. I've extended the test.

@tmds
Copy link
Member Author

tmds commented Nov 9, 2021

@dotnet/area-system-io @stephentoub ptal.

@tmds
Copy link
Member Author

tmds commented Nov 15, 2021

@jeffhandley @carlossanlop @jozkee @adamsitnik can you make some time to review the PRs I've created for System.IO: https://github.com/dotnet/runtime/pulls?q=is%3Aopen+is%3Apr+author%3Atmds+label%3Aarea-System.IO.

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, but it would be great if @carlossanlop or @jozkee could review the FileSystemEntry changes.

@tmds
Copy link
Member Author

tmds commented Nov 17, 2021

I'll look at addressing the feedback tomorrow.

Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far, only 3 things left to address:

  • Remove the AssertExtensions.EqualsTo code.
  • Please open an issue to describe the two bugs being fixed by this PR.
  • In particular, the second bug, which you mentioned in a comment in line 333 of FileStatus.Unix.cs, I'm not sure how you caught that, or if it needs a unit test to verify the change worked. Would you mind elaborating? Normally we expect to have an issue open first, where the bug is described and discussed.

Thanks for sending the PR, and apologies for the delay.

@tmds
Copy link
Member Author

tmds commented Nov 18, 2021

@carlossanlop I've created #61764 to described the issues that are fixed by this PR.

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @tmds!

@tmds
Copy link
Member Author

tmds commented Nov 18, 2021

Thanks for the review @adamsitnik and @carlossanlop!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants