adobe / aem-brackets-extension

Brackets extension for Adobe Experience Manager (AEM) front-end developers with auto-sync and HTL support.
https://docs.adobe.com/content/docs/en/dev-tools/aem-brackets.html
Apache License 2.0
52 stars 22 forks source link

Importing from server exports local files back to the server #44

Closed paullh closed 9 years ago

paullh commented 9 years ago

Brackets v1.3 AEM Brackets Extension v0.0.12 Windows 7 64bit AEM 6.0 (This issue was noticed on an Adaptive Forms only project)

Issue:

When importing from server, locally held files get pushed to the server.

Steps to reproduce:

Have an AEM project already imported on a local machine. Make a change in CRXDE or in the form designer. Attempt to update local files with ones on the server by right clicking "jcr_root" and doing "import from server".

Expected outcome

Clicking "import from server" on root folder updates locally held files with latest files that are on the server.

Actual outcome

Local files get uploaded to the server instead of being updated with the new version from the server.

If I do the above steps but do the import on the .content.xml of the form, everything in that file disappears and the form is totally broken!

Context

After working in CRXDE, making styling changes etc or making changes to forms, doing "import from server" on the jcr_root folder, it will actually export the local files to the server.

The project is effectively rolled back to an earlier version.

Deleting the files and re importing allows you to get the files locally to submit to version control but it still doesnt fix the issue where if you change something on the form, the changes get reverted on import.

This problem comes and goes and its very hard to pin down exactly what's causing it. If anyone has suggestions on how to track it down more effectively, I'd love to hear them.

vladbailescu commented 9 years ago

This happens because automatic sync/exports is triggered by filesystem changes. When the import happens the filesystem will fire change events and trigger exports to server. This could be fixed if we disable automatic sync/exports during import phase.

rombert commented 9 years ago

That does sound familiar :-) In the Eclipse plugin we associate a timestamp property with each imported file. When exporting we check the last modified date ; if it's older or equal to the import timestamp we skip the export, otherwise we perform the export and clear the import timestamp.

paullh commented 9 years ago

Thanks for the replies. It would be great if you could separate the sync and import/export functions. Maybe there could be an extra option in the AEM dropdown where you can turn on or off automatic sync. Also the timestamps definitely seem to be the culprit. If the import/export functionality could ignore the timestamp and "forcely" carry out the action then you could be sure that whatever you did worked as expected no matter what brackets thinks is the more up to date file.

vladbailescu commented 9 years ago

I'm working on some improvements related to sync, I'll consider both suggestions.

Thanks, Vlad

On Monday, June 15, 2015, paullh notifications@github.com wrote:

Thanks for the replies. It would be great if you could separate the sync and import/export functions. Maybe there could be an extra option in the AEM dropdown where you can turn on or off automatic sync.

— Reply to this email directly or view it on GitHub https://github.com/Adobe-Marketing-Cloud/aem-sightly-brackets-extension/issues/44#issuecomment-112118818 .

Sent from mobile