Skip to content
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] [File Watchers] Renaming a file that's alone in a folder duplicates it in project tree #5883

Open
core-ai-bot opened this issue Aug 30, 2021 · 30 comments

Comments

@core-ai-bot
Copy link
Member

Issue by couzteau
Saturday Jan 11, 2014 at 00:15 GMT
Originally opened as adobe/brackets#6474


new description:

  1. Open Getting Started project
  2. Open and close the screenshots folder
  3. switch to finder and rename screenshots/quick-edit.png to screenshots/test.png

Bug: a) The image test.png is now listed twice in the project tree
b) The folder screenshots has been opened.

old description:
Steps:

  1. Open Getting Started project
  2. switch to finder
  3. rename screenshots/quick-edit.png to screenshots/test.png

Bug: The image test.png is now listed twice in the project tree

I wouldn't be surprised if adobe/brackets#6001 was related. - verified. It's not!

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Saturday Jan 11, 2014 at 00:22 GMT


Looking at adobe/brackets#6468 to see if that fixes the issue.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Saturday Jan 11, 2014 at 00:24 GMT


Tagging fix in progress

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Saturday Jan 11, 2014 at 00:44 GMT


adobe/brackets#6468 does fix the duplicate entry. But there is a (minor?) side effect: the folder containing the image is collapsed when brackets gains focus.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Saturday Jan 11, 2014 at 00:45 GMT


No "fix in progress" tag yet. Tagging again.

@core-ai-bot
Copy link
Member Author

Comment by iwehrman
Saturday Jan 11, 2014 at 01:48 GMT


Should now be fixed by #6468. FBNC to@couzteau.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Saturday Jan 11, 2014 at 01:55 GMT


Confirmed on the last bit about the collapsed folder. But I never got that to reproduce the first time. Please retest on master, thanks!

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Saturday Jan 11, 2014 at 03:12 GMT


I still see the collapsed folder every time. If you follow the steps in the bug description, but make sure to expand the screenshots folder before you rename, you should see it too.

Leaving the bug open for now, but I'd be ok to close this one and open a new one about the closed folder. But I'd like to hear wether you can repro that.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Saturday Jan 11, 2014 at 03:51 GMT


Now I do see the duplicate entries on master again.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Saturday Jan 11, 2014 at 18:06 GMT


I have fixed adobe/brackets#6001 on a branch off of master after the merge of jason's fix but that also doesn't fix the duplicate item.

branch: https://github.com/adobe/brackets/tree/couzteau/fix-6001-imgPreview-dupeOpen

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Monday Jan 13, 2014 at 04:20 GMT


FYI There are 3 new pull requests around the file tree

#6494 fix rename events
#6495 fix expand/collapse state
#6496 undo file delete

I've got a branch that merges all 3 fixes jasonsanjose/issue-6474-again and I see different behavior with the Getting Started project.

When renaming ANY file in the getting started project, the tree doesn't update for me at all. If I create a copy of the project folder on my desktop, the tree updates...but I see@couzteau's bug where the folder node appears to close even though the style visible is still jstree-open. Toggling the node twice to collapse and expand will show the renamed file with the correct name.

Is it possible that being in the git repo has something to do with this bug?

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Monday Jan 13, 2014 at 04:47 GMT


I take that back, I can't reproduce the bug with jasonsanjose/issue-6474-again.

It looks like the change event doesn't work for the Getting Started project case because in our dev env we use a symlink to get to the getting started projects.@couzteau Can you try this bug on any other project that's not using a symlink in the ancestor path?

@core-ai-bot
Copy link
Member Author

Comment by julieyuan
Monday Jan 13, 2014 at 07:17 GMT


This duplication issue also reproduces for folders and files. Is it possible to fix it with this one or it has been fixed with latest pull request?

Steps for case folder name:

  1. Launch Brackets and open a project.
  2. New a folder (folder1) in this project.
  3. New a subfolder (folder2) or a file under folder1.
  4. Rename the subfolder(folder2) or this file on OS and observe the project tree in Brackets.

Result: In the project tree, it will show duplicated subfolder name.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Monday Jan 13, 2014 at 17:31 GMT


@julieyuan it looks like this is fixed by one of the pull requests above. I tested using branch that merges all 3 PRs jasonsanjose/issue-6474-again.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Monday Jan 13, 2014 at 18:35 GMT


I quickly tested master and I also see the fix. Will test a bit more before closing.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Monday Jan 13, 2014 at 18:36 GMT


FBNC

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Monday Jan 13, 2014 at 23:11 GMT


Confirmed fix. Closing.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Monday Jan 13, 2014 at 23:17 GMT


tested some more and I started to see the issue again. Currently I see this issue every time. Not sure what changed. Certainly not the code. I first saw it again, when reverting the name change I had previously made to verify the fix. The next thing is that I switch back to the Finder hit CMD-Z to revert the name change and Brackets updates the file tree, before it gains focus.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Monday Jan 13, 2014 at 23:46 GMT


Currently I see this issue every time with the Getting started project. Other projects do not show the bug.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Monday Jan 13, 2014 at 23:48 GMT


Sometimes i see the old and the new file names in the project tree instead of the duplicate item.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Monday Jan 13, 2014 at 23:52 GMT


@couzteau based on that, do you think we can re-title this bug as a symlink issue and not a more general problem?

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Tuesday Jan 14, 2014 at 00:05 GMT


@jasonsanjose Yes, but I'm not sure that that is really the issue. I have just reproduced the issue after it went away again via Finder's Undo, that is first rename is working fine, then going back to Finder Undo and then it comes back,

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Tuesday Jan 14, 2014 at 01:05 GMT


The reason I'm not convinced this has something to do with symlinks is that I can repro th bug when I open the getting stater project by point the brackets open project dialog directly to the getting started folder on disk.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Tuesday Jan 14, 2014 at 20:00 GMT


There might be a related fix here adobe/brackets#6520, but it only affected file renames inside of brackets, not from external renames. But it could be possible that you had a rename in brackets that created an invalid cache of DOM nodes, leading to errors later on.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Tuesday Jan 14, 2014 at 21:10 GMT


Checked out branch adobe/brackets#6520 but I still see the issue. I have also deleted cef_data before testing to eliminate the odd chance that I was running of of stake or bad data.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Tuesday Jan 14, 2014 at 21:14 GMT


@jasonsanjose How can I help you to look at this? Do you want to remote into my machine. I can repro it pretty much all the time.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Tuesday Jan 14, 2014 at 21:48 GMT


Not sure what was happening, but I can reproduce it now. Investigating.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Tuesday Jan 14, 2014 at 21:59 GMT


Ok, I have done a bit more testing and I was able to create a 2nd test project to repro the issue. It appeared important that the image folder to contain only a single image.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Wednesday Jan 15, 2014 at 20:31 GMT


Looks like there is one more edge case to fix before I can close this bug, you mentioned this in the pull request discussion: externally rename a file inside a closed folder creates a duplicate entry and opens the folder.

@core-ai-bot
Copy link
Member Author

Comment by couzteau
Thursday Jan 16, 2014 at 01:46 GMT


@jasonsanjose I pushed a branch with a partial fix for the remaining case: https://github.com/adobe/brackets/compare/couzteau;fix-6474

It addresses the issue of the duplicate entry, but the closed state of the folder is not yet maintained. But I think since you are more familiar with the jstree code, you'll be able to add that.
I don't like the fix, because it just calls refresh after thing went already wrong instead of preventing thing to go wrong, but I think it's still better than the duplicate entry. Let me know what you think.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Jan 16, 2014 at 03:58 GMT


@couzteau can you try the branch in #6546 to see if this fixes the bug instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant