atom icon indicating copy to clipboard operation
atom copied to clipboard

Wrong Icon bug

Open Goldensteev opened this issue 7 years ago • 28 comments

icon_errors

hello,

I've witnessed a weird bug after doing some project refactoring. As you can see there seems to be an error concerning on of the icons, the GUI folder as th wrong icon. it seems that this bug is only concerning this folder and sometimes the Events folder. All the other folders and all the other projects are fine. I don't exactly know what information would be relevant to help solve this problem so please ask me more specifics i'll be glad to provide more information!

Thanks

Goldensteev avatar Jul 26 '18 12:07 Goldensteev

Hey mate,

It sounds like you may have been bitten by a known bug where deleting a file and creating a directory at the same path results in the folder receiving the deleted file's icon.

You can resolve this by emptying the package's cache. If that doesn't work, please let me know.

Thanks!

Alhadis avatar Jul 26 '18 14:07 Alhadis

So yeah i had already tried that and tried it again just now, but this is what im seeing now: icon_errors_part2 or this after doing the cache clearing one more time: icon_errors_part3

Goldensteev avatar Jul 26 '18 15:07 Goldensteev

Yikes. Okay, then we definitely have an issue on our hands.

Could you give me a list of packages you have installed, along with the version of Atom you're using? You can acquire the former using apm ls -i.

Alhadis avatar Jul 26 '18 15:07 Alhadis

list_packages.txt here is the list of packages. I can't for the life of me find the version but i do keep atom updated, so i guess the latest version?

Goldensteev avatar Jul 27 '18 07:07 Goldensteev

That'll probably be v1.28.2, then. You can find the Atom version in "Help -> About" which will bring up the about page for your installation (or by running atom --version from command-line).

As for the packages you've installed... nothing there that looks suspect. Are the files being loaded from a network share, or something not entirely local?

Alhadis avatar Jul 27 '18 10:07 Alhadis

indeed it's version 1.28.2

So no all the projects are in the local disk. Each project folder contains it's own git, which has always been the case. But before this problem surfaced i did do one thing which was delete the old version of the project MicroMator and replace it with MicroMatorCore. So i suspect it has something to do with that.

Goldensteev avatar Jul 27 '18 11:07 Goldensteev

But before this problem surfaced i did do one thing which was delete the old version of the project MicroMator and replace it with MicroMatorCore. So i suspect it has something to do with that.

If so, it suggests there's a bug with the file-icons:clear-cache command. Try this:

  1. Run the file-icons:clear-cache command (but don't reload Atom)
  2. Click the MicroMatorCore folder in the tree-view to hide your project files
  3. Click it again to bring them back into view

Alhadis avatar Jul 27 '18 16:07 Alhadis

Nope still not working unfortunately

Goldensteev avatar Jul 30 '18 08:07 Goldensteev

Alright, so that confirms that there might be an issue with the clear-cache command not fully clearing the session's state from the package's memory.

I'll try to look into this in greater depth next time I'm on a computer with Atom. Thanks for being patient. =)

Alhadis avatar Aug 01 '18 16:08 Alhadis

Great! if i can be of any more help providing things do not hesitate!! Thanks again!

Goldensteev avatar Aug 02 '18 07:08 Goldensteev

Sorry for the slow response. Can you please tell me what your "File System Watcher" setting is set to? Open up the Settings panel and look for this dropdown menu (it's under the first subsection you see, the one labelled "Core"):

Figure 1

Alhadis avatar Aug 09 '18 08:08 Alhadis

it's Native operating system API

Goldensteev avatar Aug 09 '18 09:08 Goldensteev

Hrm. 😟 Well, there goes that theory.

I'll crank the cache version with the next release, so whatever you're seeing will either be gone, or entirely unrelated to caching whatsoever (and that'll be the point I can't help you, since nothing short of demonic possession could be at fault...)

Alhadis avatar Aug 09 '18 09:08 Alhadis

@Goldensteev I've published v2.1.23, could you let me know if you're still experiencing this issue after upgrading?

Thanks!

Alhadis avatar Aug 13 '18 13:08 Alhadis

Unfortunately no it seems it hasn't solved the issue :/

Goldensteev avatar Aug 13 '18 13:08 Goldensteev

Okay, I want you to run the following steps:

  1. Open up the dev-console
  2. Run AtomFS.grep("name-of-affected-file.py");
  3. You'll see an array like this. How many entries does it have?

Alhadis avatar Aug 13 '18 14:08 Alhadis

Hey i'm jumping in here to say that I'm having similar issues. It does seem to get "triggered" by deleting a file and making a folder of the same name, but after that there will be days or weeks of this package having issues with all kinds of paths in that project, even after clearing the cache.

It also really fucks with a lot of other parts of atom when it happens. Grammars will apply wrong, if a file has a folder icon on it it will open in a "background" tab (it will open, but it won't be the focused tab when it does), and my linter won't run on that file. Often times clearing the file-icons cache will cause it to switch from a folder and icon both having the "folder" icon, to both having the "file" icon (in my case, usually JS or CSS), which causes less weirdness but still is broken and often other file in that folder are still a bit weird acting.

I'm currently not having the problem, but I figured if it can help narrow down anything I might as well try.

Windows 10 Atom 1.30.0-beta1 A metric ton of plugins, i can get a full list if you want it.

Importantly, disabling this plugin doesn't seem to help fix the problem when i'm having it (the symptoms still show, even though the icons are correct), until after a restart, but then enabling the plugin again will instantly cause the problem to show back up (even uninstalling instead of disabling shows the same results).

Klathmon avatar Aug 13 '18 14:08 Klathmon

iconsbug3 iconsbugdev_out

so here is the output, as you can see i think it doesn't detect Events as a Directory it seems.

To add to what Klathmon just said, for me disabling the package does solve the issue and the native icons are not bugged.

Goldensteev avatar Aug 13 '18 14:08 Goldensteev

Just to clarify, the native icons are always correct when I disable the plugin, but the "side effects" (tabs opening unfocused, wrong grammars applied, etc..) are still there for me.

Klathmon avatar Aug 13 '18 14:08 Klathmon

Oh yes indeed yeah i'm having those issues also when the plugin is active.

Goldensteev avatar Aug 13 '18 14:08 Goldensteev

JFC.

Alright, this is a shot-in-the-dark, but try editing the installed package's package.json file to remove these lines:

"atom.file-icons": {
	"versions": {
		"1.0.0": "suppressFOUC"
	}
}

@Goldensteev You're running on Windows, right? I'm using a friend's MacBook and can't reproduce this when I delete a file and create a folder of the same name... :\

Alhadis avatar Aug 13 '18 14:08 Alhadis

I am indeed running windows 10

Goldensteev avatar Aug 13 '18 14:08 Goldensteev

Okay, so that suggests it might be a Windows-specific issue.

I'll have a second shot at getting Vagrant/VirtualBox installed on this thing (it gave weird install errors last time) to investigate what might be happening on Windows. 😞

Alhadis avatar Aug 13 '18 15:08 Alhadis

Nope not doing anything (FYI my package.json doesn't look like the one that is in the git the lines where on line 140 or something (not too familiar with .json) is that normal?

Goldensteev avatar Aug 13 '18 15:08 Goldensteev

Alright, good to know.

FYI my package.json doesn't look like the one that is in the git the lines where on line 140 or something (not too familiar with .json) is that normal?

Yeah, that's normal. 😉 Installing Atom packages or NPM modules will mangle package.json files with site-specific metadata relating to the installed dependencies and stuff. No need to worry.

Alhadis avatar Aug 13 '18 15:08 Alhadis

capture Having the same issue with file-icons 2.1.24 and atom 1.29 on Windows 10. None of the fixes in this thread worked.

jackw01 avatar Aug 25 '18 15:08 jackw01

I've been unsuccessful with replicating this, I'm afraid. 😞 However, I have noticed something strange (which affects macOS). The weirdness occurs when using the "Save as..." command to save an opened document to a different file extension – having the old filename open in a tab causes some very weird behaviour where both icons update if either of them changes.

Looking at the code shows a pretty obvious race condition, so I'll have to fix it...

Alhadis avatar Aug 29 '18 13:08 Alhadis

I can still see this effect in versions below:

Atom: 1.32.2 x64 on windows 10 file-icons package: 2.1.26

Here is a screenshot: image

@Alhadis To check yourself you can checkout the mremoteng git repo and look in: mRemoteV1\Resources\Help\

This should give you the same results.

Tested with and without tree sitter and it the results are the same. Not sure if it could have something to do with it loading Git/Github tab.

nmat avatar Nov 15 '18 20:11 nmat