settings-view icon indicating copy to clipboard operation
settings-view copied to clipboard

Unfamiliar directories loaded as packages in /dev/packages

Open Alhadis opened this issue 7 years ago • 0 comments

Prerequisites

Description

Subdirectories within ~/.atom/dev/packages are being interpreted as packages, even when required files like package.json are missing:

Figure 1 Figure 2

Contents of ~/.atom/dev/packages/u/ are only symlinked project folders:

TMCG -> ~/Labs/TMCG
archive-view -> ~/Forks/Atom/ArchiveView
find-and-replace -> ~/Forks/Atom/FindAndReplace
fuzzy-finder -> ~/Forks/Atom/FuzzyFinder
grammar-selector -> ~/Forks/Atom/GrammarSelector
language-coffee-script -> ~/Forks/Atom/CSON
language-css -> ~/Forks/Atom/CSS
language-javascript -> ~/Forks/Atom/JS
language-less -> ~/Forks/Atom/Less
language-make -> ~/Forks/Atom/Make
language-xml -> ~/Forks/Atom/XML
tabs -> ~/Forks/Atom/Tabs
tree-view -> ~/Forks/Atom/TreeView

Steps to Reproduce

  1. Create a folder inside your ~/.atom/dev/ directory
  2. Name it anything except packages.
  3. Start Atom in dev-mode
  4. Open settings-view, and click the Packages tab
  5. Scroll to the bottom of the list

Expected behaviour:
I shouldn't see undefined anywhere in the packages list. Not until somebody publishes something sick with that name, at least.

Actual behaviour:
I have undefined chilling at the bottom of the installed packages list.

Reproduces how often:
100% more often than I'd like.

Versions

settings-view: 0.247.0, bundled copy (e.g., it's not been dev-linked)

atom --version output:

  • Atom: 1.15.0
  • Electron: 1.3.13
  • Chrome: 52.0.2743.82
  • Node: 6.5.0

apm --version output:

  • apm: 1.15.3
  • npm: 3.10.5
  • Node: 4.4.5 x64
  • Python: 2.7.13
  • Git: 2.12.2

Additional Information / Background

I know how weird those screenshots look, so I'd better supply some background on why there's a folder named u in my ~/.atom/dev/packages directory...

I wrote a shell-script which bundles numerous Atom-specific tasks I run from command-line. The task in question "toggles" all dev-linked packages by simply renaming ~/.atom/dev/packages to ~/.atom/dev/u instead.

I was investigating file-icons/atom#580 and disabled my dev-linked forks so I could reproduce the reported error. Note my copy of tree-view is using atom/tree-view#1009, so any bugs related to code-tampering are missed while I'm working... hence why I frequently need to unlink/relink 5 packages at once.

I also noticed while writing this that reactivating a package moves unfamiliar folders back inside ~/.atom/dev/packages/ directory. Which is to say, ~/.atom/dev/packages/u should be located at ~/.atom/dev/u instead. Don't think that should be happening, either...

EDIT: I also noticed that Atom's load-time sank to HELL when it was trying to load u as a package. I'm guessing it was going through each subdirectory and loading each contained file as a package resource. Nothing else was coming up in Timecop, so the lag was puzzling until now.

Alhadis avatar Apr 05 '17 13:04 Alhadis