Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

IFileProvider Deleting file does not fire Watch IChangeToken #192

Closed
HaoK opened this issue May 19, 2016 · 6 comments
Closed

IFileProvider Deleting file does not fire Watch IChangeToken #192

HaoK opened this issue May 19, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@HaoK
Copy link
Member

HaoK commented May 19, 2016

Expectation is that delete will fire the IChangeToken returned from Watch

        [Fact]
        public void DeletingFileWillFire()
        {
            var fileProvider = new PhysicalFileProvider(_basePath);

            var token = fileProvider.Watch("test.txt");
            Assert.False(token.HasChanged);
            File.WriteAllText(Path.Combine(_basePath, "test.txt"), @"{""JsonKey1"": ""JsonValue1""}");
            Assert.True(token.HasChanged);

            var token2 = fileProvider.Watch("test.txt");
            Assert.False(token2.HasChanged);
            File.Delete(Path.Combine(_basePath, "test.txt"));
            Thread.Sleep(1000);
            Assert.True(token2.HasChanged, "Deleted");
        }
@HaoK
Copy link
Member Author

HaoK commented May 19, 2016

Maybe related to #34?

@HaoK
Copy link
Member Author

HaoK commented May 19, 2016

Discovered by aspnet/Configuration#433

@divega
Copy link

divega commented May 25, 2016

@muratg @Eilon can this be triaged for RTM?

@Eilon
Copy link
Member

Eilon commented May 26, 2016

Yeah this looks pretty broken.

@muratg
Copy link

muratg commented May 26, 2016

@victorhurdugaci Please investigate. If the root cause is in CoreFX, let's file a bug there.

@victorhurdugaci
Copy link
Contributor

The token triggers on delete. It's not a file system issue. See the comments in aspnet/Configuration#433 for the root cause

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants