Conflict detection does not work if other users use the MavensMate Sublime plugin.

Issue #286 resolved
Sam Theisens created an issue

In our organisation we have been using the Mavensmate sublime plugin until now, but we would like to switch to IlluminatedCloud. Unfortunately we have not been able to make the switch across our team. We seem to have a problem with conflict detection that I haven't seen reported by other users.

Steps to reproduce: 1. User A (using Sublime): modify and deploy a file. 2. User B (using IlluminatedCloud): without refreshing metadata, modify and save (Cmd+S) the same file.

Expected outcome: user B is prompted that the file cannot be deployed due to a conflict Actual outcome: the modification that user B made is deployed without warning. All our team members have individual Salesforce accounts.

This is a screenshot of the configuration settings that we use:

shared-logins.png

Comments (11)

  1. Scott Wells repo owner

    Sam, thanks for the report. Let me explain how IC is performing conflict detection in each case:

    • Dedicated Logins - If the metadata requested for deployment has been most recently modified in the org by another user, a conflict is reported.
    • Shared Logins - If the metadata requested for deployment has been modified in the org more recently than the last time the metadata was deployed to or retrieved from the org, a conflict is reported. Time comparisons are made based on timestamps from the server adjusted by the difference between the local and org timezones.

    If you have distinct logins, can you change the setting from Shared Logins to Dedicated Logins and see if the outcome is the same? Please let me know your findings.

  2. Sam Theisens Account Deactivated reporter

    Hi Scott, thanks for your swift response. I see that I've attached the wrong screenshot. I am actually using the Dedicated Logins setting. From your description on how conflicts are detected I don't see how conflict detection could fail in our case. I suspect MavensMate uses the same method to detect conflicts and with MavensMate it works fine.

  3. Scott Wells repo owner

    Yes, I'm pretty sure that MM uses a similar conflict detection approach. I'm going to be adding some diagnostic logging this area for #287 and will add enough in this area so that we can figure out what's going on here. I'll let you know when that has been added and how to use it to provide me the diagnostic info.

  4. Scott Wells repo owner

    Sam, I've attached a test build to issue #287 with what I hope is enough diagnostic logging to get to the bottom of this. Please follow the instructions in the 3rd and 12th comments in that issue to install the build, enable the appropriate level of logging, reproduce the issue, and extract the resulting logged info. Once you've done that, send over the relevant portions of the logs and hopefully I'll see what's going on more clearly.

  5. Sam Theisens Account Deactivated reporter

    Thanks Scott. This is the logging I am getting when I save a file that has been modified by another person:

    2016-03-23 10:59:00,737 [ 299634]  DEBUG - tellij.builder.ForceComBuilder - Local file not on server: src/classes/Attributeable.cls 
    2016-03-23 11:02:35,335 [ 514232]  DEBUG - tellij.builder.ForceComBuilder - Comparing local to server timestamps for src/classes/Attributeable.cls: 
    2016-03-23 11:02:35,335 [ 514232]  DEBUG - tellij.builder.ForceComBuilder -   lastDeployedDate       = null 
    2016-03-23 11:02:35,335 [ 514232]  DEBUG - tellij.builder.ForceComBuilder -   serverLastModifiedDate = null 
    2016-03-23 11:02:35,335 [ 514232]  DEBUG - tellij.builder.ForceComBuilder -   localLastModifiedDate  = Wed Mar 23 11:02:35 CET 2016 (raw) 
    2016-03-23 11:02:35,335 [ 514232]  DEBUG - tellij.builder.ForceComBuilder -   localLastModifiedDate  = Wed Mar 23 11:02:34 CET 2016 (adjusted) 
    2016-03-23 11:02:35,335 [ 514232]  DEBUG - tellij.builder.ForceComBuilder - Local file not on server: src/classes/Attributeable.cls 
    2016-03-23 11:02:43,267 [ 522164]  DEBUG - tellij.builder.ForceComBuilder - Comparing local to server timestamps for src/classes/Attributeable.cls: 
    2016-03-23 11:02:43,267 [ 522164]  DEBUG - tellij.builder.ForceComBuilder -   lastDeployedDate       = null 
    2016-03-23 11:02:43,267 [ 522164]  DEBUG - tellij.builder.ForceComBuilder -   serverLastModifiedDate = null 
    2016-03-23 11:02:43,267 [ 522164]  DEBUG - tellij.builder.ForceComBuilder -   localLastModifiedDate  = Wed Mar 23 11:02:42 CET 2016 (raw) 
    2016-03-23 11:02:43,268 [ 522165]  DEBUG - tellij.builder.ForceComBuilder -   localLastModifiedDate  = Wed Mar 23 11:02:41 CET 2016 (adjusted) 
    2016-03-23 11:02:43,268 [ 522165]  DEBUG - tellij.builder.ForceComBuilder - Local file not on server: src/classes/Attributeable.cls 
    

    It seems to think the file is a new one.

  6. Scott Wells repo owner

    Thanks, Sam. I believe I see the problem here, though I'll need to understand how/why it's in this state. Where it's listing a path of src/classes/Attributable.cls, it should be listing a path of classes/Attributable.cls. That's intended to be a source root-relative path where src is the source root. How is the source root for your module configured? You can see this by going into File>Project Structure and then selecting Modules>yourModuleName and clicking on the Sources tab. It should look something like:

    SourceRoots.png

    where only src is configured as a source folder. My guess(/hope) is that once that's squared away and you rebuild caches & indices (which are constructed based on the current configuration), things will work properly for you.

  7. Sam Theisens Account Deactivated reporter

    Yep, that did the trick. Thanks a lot! Now we can all switch to IlluminatedCloud.

    2016-03-23 15:49:03,203 [17702100]  DEBUG - tellij.builder.ForceComBuilder - Comparing local to server timestamps for classes/Attributeable.cls: 
    2016-03-23 15:49:03,203 [17702100]  DEBUG - tellij.builder.ForceComBuilder -   lastDeployedDate       = Wed Mar 23 15:47:49 CET 2016 
    2016-03-23 15:49:03,203 [17702100]  DEBUG - tellij.builder.ForceComBuilder -   serverLastModifiedDate = Wed Mar 23 15:48:36 CET 2016 
    2016-03-23 15:49:03,203 [17702100]  DEBUG - tellij.builder.ForceComBuilder -   localLastModifiedDate  = Wed Mar 23 15:48:56 CET 2016 (raw) 
    2016-03-23 15:49:03,203 [17702100]  DEBUG - tellij.builder.ForceComBuilder -   localLastModifiedDate  = Wed Mar 23 15:48:55 CET 2016 (adjusted) 
    2016-03-23 15:49:03,203 [17702100]  DEBUG - tellij.builder.ForceComBuilder - Local file newer than server representation: classes/Attributeable.cls 
    2016-03-23 15:49:03,203 [17702100]  DEBUG - tellij.builder.ForceComBuilder - Server file was last modified by a different user (expected 00524000000RPe1AAG, found 00524000001HdqKAAS) and should be merged: classes/Attributeable.cls 
    2016-03-23 15:49:03,784 [17702681]  DEBUG - tellij.builder.ForceComBuilder - The following files need to be merged: 
    2016-03-23 15:49:03,784 [17702681]  DEBUG - tellij.builder.ForceComBuilder - classes/Attributeable.cls - last modified by ... on Wed Mar 23 15:48:36 CET 2016 
    
  8. Scott Wells repo owner

    That's what I like to hear! Thanks for following up and for patiently helping me debug this.

  9. Log in to comment