Brackets: File-tree crashes after filename interference problems

Created on 27 May 2016  路  11Comments  路  Source: adobe/brackets

The title is a bit cryptic, but the steps are really simple:

  1. Create a folder called foo/.
  2. In the folder create a file called bar (without an extension)
  3. Try to create a folder called bar, get error about the file/directory existing
  4. Remove the file called bar
  5. Try to create a folder called bar

Expected: Folder called bar is created.

Actual: Folder called Untitled-1 is shown on the filetree (but not created), error Uncaught TypeError: undefined is not a function is thrown at `ProjectModel#L187 and the folder is unusable until restart. After this many of the file tree functions in general don't work correctly.

Tested on: Latest master https://github.com/adobe/brackets/commit/8093791728cbff6f7734fbad41882481c82087f9, newest MacOS

All 11 comments

ChainsawFist has found a solution to this as well. What needs to happen is that the file cache needs to be refreshed before the ProjectModel (project/ProjectModel.js) javascript goes into it's logic for the function doCreate(). Typing var fs = _getFSObject(path); as the line after var d = new $.Deferred(); in the doCreate() function seemed to have fixed the issue. However fs is never used, so while that is a solution it's not a great one. Looking at the contents of _getFSObject(path), it might actually make sense to use fs in place of both directory and file variables in the doCreate().

Using fs as the variable works in place of directory and file.

Wow, I wasn't even able to repro this on my machine...

Didn't work on your machine or you weren't seeing this bug? This worked on a Mac just to clarify what machine I'm using.

If this fixes the problem then I'll do the tests (I just have to do the smoke tests now) and create a PR.

I wasn't seeing the issue. Tried several things, but it didn't blow up.

@petetnt, are you still getting the issue?

@jamran7 couldn't replicate it anymore on my Windows 10 PC against latest master, I'll try later against my macOS too to see if this still occurs there.

Do not collaps foo/. That fixes the problem within foo because it refreshes the file index. Without collapsing the folder, say you create bar and bar/ in the work space, the problem exists.

It happens on my latest commit of Brackets

Is this still an issue @petetnt?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hi,
KSSS10 picture KSSS10  路  3Comments

edlau picture edlau  路  3Comments

mrapino picture mrapino  路  3Comments

TheHedge picture TheHedge  路  3Comments

udaykapur picture udaykapur  路  4Comments