-
Notifications
You must be signed in to change notification settings - Fork 0
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
[CLOSED] Apply exclude filter when handling fs events. #9129
Comments
Comment by busykai
|
Comment by dangoor
The change you've got here makes sense to me, but I'd prefer someone who knows the filesystem better to decide about that half of the change. Also, I'd rather not see ProjectModel changes that don't include a test change. |
Comment by busykai
|
Comment by ingorichter
|
Comment by busykai
|
Comment by peterflynn So my concern with this is that FileSystem is supposed to guarantee that there are never two File/Directory entries representing the same path. Without putting entries in the index, that's impossible. There aren't too many places in Brackets where we actually rely on that assumption, and I'm not sure if things inside the .git folder could ever run up against any of those cases anyway... but as a generic fix this makes me a little uncomfortable. I wonder if a cleaner approach would be this model:
This would still fix the project tree bug, without violating the 'singleton' entry guarantee, and still allows using these FS APIs to read/write filtered files. I think this is also pretty easy to implement:
Note that there's still some performance overhead from .git churn because the Node native watcher sends all the events over to FileSystem before they get ignored in
|
Comment by busykai
|
Comment by dangoor
|
Comment by busykai
your suggestion works when the changes are external. it seemingly fixes the problem with running the root cause of this is that we filter by the file's base name without checking if the parent is not watched, that is we match while one could argue whether this a bug or a feature, I suggest that we fix this by "inheriting" what you think? |
Comment by ingorichter
|
Comment by peterflynn
1)
2) File I/O done via Brackets APIs will dispatch FileSystem events for that item even if it's unwatched or filtered out.
|
Comment by peterflynn For issue 2, I've realized the solution I like (no 'forced events' for filtered entries) introduces a slight pitfall. If parts of Brackets expect to always reliably get change events for its own changes, that expectation is violated if the user (or an extension) manually hands that part of Brackets a filtered-out file. For the rename case this isn't currently possible, but that's only because you can only rename things that appear in the tree; in the future, we might allow renaming directly from the working set, and you can get filtered-out items into the working set by manually picking with File > Open. One option is just to make sure no parts of Brackets have this assumption (if rename is the only case, may be easy to fix). Another option is to go with the other fix suggestion instead: just add back in the filtering double-check in the project tree code. Slight perf hit but probably negligible. |
Comment by busykai
for the issue 2) it seems like if we don't cause |
Comment by busykai
|
Comment by busykai
|
Comment by busykai FWIW, Intel XDK has been using this improvement (in as-is form) for 5 months now without any issues. |
Comment by zaggino Yep, this is taking far too long... |
Comment by abose
|
Comment by zaggino
|
Comment by busykai
|
Comment by abose Thnaks |
Comment by busykai Thank you, |
Issue by busykai
Saturday Jan 03, 2015 at 23:48 GMT
Originally opened as adobe/brackets#10304
This resolves the issue with
ProjectModel
not applying exclude list when handlingFileSystem
change.This PR fixes part 2 of the issues described in #10183.EDIT:
This PR fixes #10183, see this comment for the issue definition:
FileSystem._index
when the requested entry is filtered.It might be so that 6514f20 actually draws 5d181f5 useless since no more events will be generated and the filtering will be done at
FileSystem
level, but there's no penalty on having 5d181f5 in place as well.busykai included the following code: https://github.com/adobe/brackets/pull/10304/commits
The text was updated successfully, but these errors were encountered: