Dyalog / link

Source code for Link – the built-in component that enables the use of text files as the primary storage mechanism for APL source code
https://dyalog.github.io/link
MIT License
19 stars 10 forks source link

Link.Add followed by an immediate Link.Break causes confusing warning #484

Open aplteam opened 2 years ago

aplteam commented 2 years ago

Describe the bug

When I first issue a Link.Add on an existing function Foo (because it got changed) and then call Link.Break immediately afterwards I get something like

Link Warning: ⎕SE.Link.Notify: changed C:/.../Foo.aplf: path not in a linked directory

which is confusing.

A ⎕DL 1 between the two calls fixed the problem.

I am on Link 3.1.1

This is my <02006>

mkromberg commented 2 years ago

I don't think there is a "perfect" fix for this, what is happening is that the file system watcher event which is caused by Link updating the file is arriving after Link.Break, so the warning is perfectly correct and this is "not a bug". If you updated the file, expected the file system watcher to use the event to define something in the workspace but you call Break before it is processed, you might want to know about it. i suppose we could add some kind of logic to record that a break was done very recently and we (Link) updated that file very recently and therefore the change can be ignored, but it seems questionable.

aplteam commented 2 years ago

Well, I have watch=ns, so there should be no file system watcher...

mkromberg commented 2 years ago

Well, that seems "impossible", without a file system watcher there should be no notifications on changed files at all. Do you have a complete repro for this that I can look at?