Local project files are sometimes not updated after a metadata retrieval

454 views
Skip to first unread message

Vivek Chawla

unread,
Nov 30, 2015, 2:26:27 PM11/30/15
to Illuminated Cloud General Discussion
Not sure if this is a bug with Illuminated Cloud or a feature of IDEA's file management system.  Here is what I'm seeing.

Last night, after performing a project-wide metadata retrieval via Illuminated Cloud, files that I know have been modified in the org were not getting those updates saved to the local project files.

The diff tool was able to confirm that the incoming files were indeed different than the local project files.  As far as the diff tool was concerned, I "moved" those changes from left to right (org to local).

The only problem was that the local files would not update (they were open in the editor at the time).  Finally, I tried refreshing the project using the synchronize button in the main toolbar.  I got a warning message saying that there are changes on disk and memory that may overwrite open files (at least, I think that's what it said...I clicked through that dialog a bit too quickly.  My bad)

Once I clicked the synchronize button, all the local files appeared to have the correct updates and matched the org versions.

This morning, I tried again, only this time I kept the local files closed until after the retrieval / diff / left-to-right-move was complete.  Each file opened with the old version, then within about 10 seconds, the contents of the editor automagically changed to the correct, updated version from the org.

Here's what I want to know:

  • Is this behavior normal for IDEA?  My expectation is that once I bring a file "from left to right" in the diff tool, then the changes should be immediately visible in local editors and on disk.
  • Do I need to force myself to get into the habit of clicking IDEA's Synchronize button after each metadata retrieve I do?
  • Is there anything that Illuminated Cloud can do to streamline this process?
Thanks,
Vivek

Scott

unread,
Nov 30, 2015, 2:37:41 PM11/30/15
to Illuminated Cloud General Discussion
IntelliJ IDEA does use a caching virtual file system to abstract the specifics of the underlying file system and to make things more efficient.  It's generally quite good at keeping things up-to-date based on frame activation, but there are times that you have to give it a nudge using the Synchronize button.  If you've disabled its sync-on-frame-activation, you'll likely find yourself having to click that button often (or use the keyboard shortcut).

Speaking specifically about Illuminated Cloud and its metadata retrieve, I've tried to instrument that operation to force synchronize things at a few key points along the way, in particular after the archive has been retrieved and extracted into the file system and again after retrieval substitution rules are applied before the directory comparison tool is shown.  I don't force sync after the directory comparison tool is closed because that's an async operation and I don't have any way to trap its completion.  Assuming that you're using IntelliJ IDEA's directory diff tool, I would think it would be in sync already, but it sounds like that may not be the case.  If you do use an external directory diff tool like Beyond Compare or Araxis Merge (I use Beyond Compare personally), IDEA should catch up when it again receives focus.

Based on your description ("within about 10 seconds"), it sounds like IDEA is auto-syncing, but perhaps it's doing so slowly?  I've generally seen this be closer to real-time.  After the retrieve and copy left-to-right, can you watch the status bar and see when IDEA's sync/index kicks in?  I'd like to know how long it's taking so I can investigate further to understand why there might be a delay.

Regards,
Scott

Vivek Chawla

unread,
Dec 2, 2015, 7:26:57 PM12/2/15
to Illuminated Cloud General Discussion
I've got some updated information about this issue.

I've been keeping an eye on the status bar, but I don't see any "working" or "progress" indicators.   I've timed the delay to be as short as 5 seconds, and as long as 17 seconds.  Not sure what to correlate with the various times, because it feels like I'm doing the same thing each time (basically, sitting there waiting, or clicking other windows then clicking back to IntelliJ IDEA).

I'll keep working to see if I can narrow down a cause.

Scott

unread,
Dec 2, 2015, 7:33:19 PM12/2/15
to Illuminated Cloud General Discussion
Yeah, keep me posted.  I just did a quick test where I brought over six Apex classes that were in the org but not local.  I used IntelliJ's built-in directory diff tool just to make sure there wasn't any application switching.  When I closed the directory diff tool, the new files were in the project immediately.  Obviously that's not what you're seeing, so I'm curious as to the difference.  I may ask a few folks more familiar with how this is working than I'm am to see if they might be able to shed some insight.
Reply all
Reply to author
Forward
0 new messages