-
Notifications
You must be signed in to change notification settings - Fork 252
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
Notify FileSystem on resource deletion #693
Notify FileSystem on resource deletion #693
Conversation
Hey @Lassi, thanks for the help. 👋 It's currently difficult for me to get to a computer with Atom installed, so your pull-request is warmly welcomed. Do the package specs pass? You'll need to install cd /path/to/file-icons
apm install . Then, from Atom's View menu, go to Developer... and then Run Package Specs. I'll fix the JS style issues myself, I won't nag you to do it for me. :-) I'm in no position to be picky over formatting, haha. |
Hey @Alhadis, My pleasure! It allowed me to learn a few things about Atom ;) Thanks a lot for the help, I wasn't sure how to run the specs. There is 3 failures but the broken tests also seem to fail on master so I'm not sure if they are linked to the code I introduced or not. I'll try to look into it when I have a minute. If you have any suggestion regarding formatting please let me know, I don't mind fixing it at all! |
Ah... Please don't worry those spec failures. You're right, those definitely aren't related to the PR.
Alright, well I personally prefer double-quotes over single quotes, and "Yoda-style" comparisons whenever literals being evaluated: // "Yoda-style" comparison example
-if(object.method() === “value")
+if(“value" === object.method()) I also prefer no spaces between keywords and brackets. :) |
The `FileSystem` module wasn't being notified on resource deletion which resulted in an inconsistent state of the resource cache. By subscribing to deletion notifications for files in the project and destroying the resource if it's cached in the `Filesystem` module, we solve that issue. Fixes #490
Hey, Sorry for the late reply. Ok, thanks, I'll ignore the broken specs. I just fixed the commit according to your suggestions. Let me know if there is anything else you need me to change! |
Nope, you've done well. 😀 Thanks for taking the time to help us out. 😀 There's a lot about this package's current infrastructure that needs rehauling. (And it's not going to happen in the near future, unless Apple feel like dropping their price of their overly-expensive MacBooks. 👎 Either that, or one with an unsmashable screen. 💔 |
This needs corresponding handling for a "created" event. Sometimes, especially when using auto-formatters, it can leave the file in "deleted" state i.e. resource is destroyed from here, but never recreated. |
@utkarshgupta137 You're right. Ive pushed a tentative fix; would you mind checking 27e7cac out locally and seeing if it made a difference…? |
I've actually been testing my own fix since a couple of days, you can checkout the last commit: https://github.com/utkarshgupta137/file-icons-atom. I don't think your commit will fix the issue as the block inside That commit has fixed the issue I mentioned for me. |
That's actually what the issue is. Releasing a |
Okay, I'm still able to recreate the issue with your commit. First Also, the issue can also happen after you commit/reset files. |
Maybe it's my crappy ancient MacBook, but I've never been able to replicate this locally (it's a known issue, BTW). The real issue is that |
I'm on 10.15 w/ APFS. Maybe it's due to APFS? It could be handling files differently. The issue occurs when the files are created/modified "externally" i.e. by any external process that creates/modifies a file. This includes any action taken via the git sidebar. If the same action occurs through atom, then there are no issues. |
Possibly. I'm running a HFS filesystem, and I'm (stuck) on 10.13.6 (High Sierra, which recently reached EOL). My machine is literally too old to upgrade to Mojave (mid-2010), and everybody's dropping support for it (Homebrew's become little more than a glorified Makefile…). |
Well, you should get those Intel-Macs before they're out of stock everywhere. Another thing: Run |
I've reverted that last commit. As you said, it solved nothing and it's now causing CI tests to fail on macOS (Linux passed, interestingly enough).
Heh. I'd rather maximise the amount of time between buying a new workstation and when Apple inevitably obsolete it like they do all their hardware. 😉 I doubt they'll bother supporting Intel hardware for long; probably 4 years, tops. I won't have enough money for a new workstation again for a looooooooong time, so I gotta make this count (I'll be broke for a while, but hey…) Also, I ran |
No no. The file icon appears fine. But the git status for it is wrong. You've gotta Enable I've raised a PR with a fix, do have a look. |
The
FileSystem
module wasn't being notified on resource deletion whichresulted in an inconsistent state of the resource cache. By subscribing
to deletion notifications for files in the project and destroying the
resource if it's cached in the
Filesystem
module, we solve that issue.Fixes #490