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

Syncing entire directory tree when one file is edited #23

Closed
aguacatedan opened this issue May 10, 2017 · 6 comments
Closed

Syncing entire directory tree when one file is edited #23

aguacatedan opened this issue May 10, 2017 · 6 comments
Assignees

Comments

@aguacatedan
Copy link

Sometimes, when a file is edited, it triggers changes in all files under the same root directory, syncing a whole directory unnecessarily. For instance, if I make a change in /jcr_root/apps/components/a/script.jsp it reports that there where changes in /jcr_root/apps/components/b/script.jsp, /jcr_root/apps/components/c/script.jsp, etc.. So, basically syncing everything under apps resulting in very long sync jobs.

We are seeing this in Windows 7 using Sublime Text 3 as the editor. Idk if this maybe has anything to do with Sublime Text.

I'm thinking if maybe there was a non-recursive flag it would solve the issue. This wasn't a big deal at first, but we then realized that whenever aemsync decided to sync the whole etc folder, it would override an non-versioned folder we have under etc in our local servers.

@Nevitones
Copy link

Hi @danielrndm
I'm having a similar issue here, it seems that the whole directory content where a file is changed/added is erased.
As I don't have all files versioned I end up losing files, sometimes standard AEM files.

It has been happening since I started running aemsync from a gulp task.

Before that I was running aemsync from the command line by typing:
aemsync
without any parameters.

Maybe it's only about a misuse of the plugin inside gulp.
I would really appreciate if somebody could share any clue about it!
Tks

@gavoja
Copy link
Owner

gavoja commented Jun 7, 2017

Syncing the parent directory rather than a file can indeed happen in certain cases:

  • Ading, removing or renaming files or directories.
  • Changing .content.xml.
  • Changing any file or directory inside nt:unstructured subtree. In this case the first non nt:unstructured ancestor will be pushed. This behaviour ensures proper handling of self-contained unstructured blocks of nodes such as dialogs that are distributed across multiple files (see Cannot sync .xml files, such as cq_dialog fields #19).

The above is now in readme. Can you please check if the behaviour is fixed in 2.0.0. If not, could you please run aemsync in debug mode (-d flag) and send me the output?

@aguacatedan
Copy link
Author

  • Commnd: aemsync -d > C:\Users\daniel.hernandez\Documents\daniel\aemsync-log.log
  • File modified: jcr_root/etc/designs/subaru/vehicles/css/components/compare-modal/src/compare-modal.css
  • Log: aemsync-log.txt
  • Setup: Windows 10 (upgraded a couple of weeks ago). AEM 6.2

I ran aemsync without any other options/parameters from jcr_root.

from what I can tell, there's a aemsync.txt file created for whatever reason and any output to that file triggers changes, thus syncing the entire jcr_root folder. But the thing is that, I've seen this happening even if I run it from jcr_root/etc/ folder. In your docs, you mentioned that any changes in files directly under jcr_root won't trigger a sync job, but (as far as I can tell), it is triggering it. Any option to avoid creating that text file and see if that's the problem?

@gavoja
Copy link
Owner

gavoja commented Jul 13, 2017

The entire designs directory ends up in a package due to the following change reported by Windows:

Changed: C:\Users\daniel.hernandez\Documents\subaru\svn\workspaces\starlink-gen3\content\jcr_root\etc\designs

The behaviour in this case is correct. I wonder whether it is your IDE, SVN or any other tool that is touching this folder.

@aguacatedan
Copy link
Author

Is there any way to know what exactly that change was? I've tried using Vim and it still happens, so I'm guessing it's not the text editor.

What options do I have for debugging this issue? I'll try and set it up in my home computer and see if maybe it's some sort of company "security" software causing this problem. I'll report back later in the day.

@gavoja
Copy link
Owner

gavoja commented Jul 13, 2017

I am not aware of any tool that would be able to tell who or what touched a file on Windows. The only thing I can recommend is to shut down processes one by one and re-trying. Checking on another machine is a good idea - let me know your findings.

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

No branches or pull requests

3 participants