Conflict check repeatedly gives warning that the server version of the file is newer even though only one user is updating the files

Issue #287 resolved
Matt Smith created an issue

Whenever I save a file the conflict check gives me a warning that the server version of the file is newer even though I am the only person updating the files in the org. I checked the Shared Logins checkbox in my org settings. I believe this issue was mentioned in Issue #152 but that item is marked as closed so I opened a new ticket.

Thanks!

Comments (18)

  1. Scott Wells repo owner

    Matt, sorry for the issues. Are you working in an org shared with other users? I ask because of the comment that only one user is updating files. Just trying to understand the usage so I can figure out next steps.

  2. Matt Smith reporter

    Thank you for the quick response Scott. Technically, yes the org is shared with other users. However, I know for a fact that none of them are doing any development within the org. If they were, I would certainly know about it.

  3. Scott Wells repo owner

    Okay, and you're sharing logins when working in the org, correct? Otherwise I'd assume you'd be using the Dedicated Logins conflict detection option. If that's the case, would you mind turning on some debug logging for me and sending the me resulting logs when this invalid conflict is being reported? You can enable debug logging under Help>Debug Log Settings by adding the following:

    #com.illuminatedcloud.intellij.builder.ForceComBuilder
    

    Once you perform a few operations that result in the conflict dialog, just grab idea.log using Help>Show Log in Explorer/Finder and send me the log output from ForceComBuilder. Feel free to scrub it for sensitive data first, of course, or to email it to me directly.

    Also, what exact message is shown in the conflict notification dialog?

  4. Matt Smith reporter

    Yes, we are sharing logins which is exactly why I did not select the Dedicated Logins option. I suspect that this issue stems from the fact that the clock on my computer seems to be about 30 seconds behind the Salesforce server. I can email you a log if you provide your email address.

    I actually noticed that I am getting a couple different warnings. The first warning I am seeing looks like this:

    *The following have no last deployment information and may need to be merged:

    • classes/MyClass.cls - updated by '<username>' on Mon Mar 21 14:23:35 CDT 2016*

    That warning pops up every time I save and select "Overwrite". If I save and select "Retrieve and Merge" then that warning will not appear the next time I save.

    The other warning that I continue to see looks like this:

    *The following are newer on the server and may need to be merged:

    • classes/MyClass.cls - updated by '<username>' on Mon Mar 21 14:39:49 CDT 2016*

    Thank you

  5. Scott Wells repo owner

    Yeah, I was wondering if it might be something like that. Shoot the logs to support@illuminatedcloud.com and I'll take a look. Assuming it is some type of disparity like that (and I'd expected to see this crop up), I'll need to come up with good options to accommodate for that.

  6. Scott Wells repo owner

    Matt, I've attached a pre-release build that is the same as the official released build but with some changes to the way that the server timezone offset is computed. It should be much more accurate because it samples server and local multiple times and computes an average that is then used when comparing server and local timestamps for incremental deployment and shared login conflict detection.

    If you get a chance, would you mind trying it out? Just download the attached archive, then from IntelliJ IDEA use Settings>Plugins>Install plugin from disk, selecting the downloaded archive. Let the IDE restart and then let me know if it addresses the problem or not.

    Thanks!

  7. Matt Smith reporter

    Looks like it did not work. I tried updating the plugin with the new version and I also uninstalled the plugin and installed the new version to no avail.

    Thanks

  8. Scott Wells repo owner

    Thanks, Matt. Just to clarify, are you saying that the pre-release build did install properly but didn't resolve the issue, or are you saying that it didn't install properly? Assuming the former, let me add some additional diagnostic logging that will tell me exactly what comparisons it's doing so that I can better understand why this is happening and how to resolve it for you (and presumably others).

  9. Matt Smith reporter

    Your assumption is correct, the plugin installed correctly but the issue itself was not fixed.

  10. Scott Wells repo owner

    Thanks again, Matt. I'll go ahead and add logging that tells me the exact calculated offset and the timestamps being compared. That should tell me exactly what's going on. I'll see if I can post a new pre-release build with that info this afternoon.

  11. Scott Wells repo owner

    Okay, I'm attaching another test build that has been instrumented with logging to help diagnose what's going on here. The logging is in the same class references above ForceComBuilder and is enabled in the same manner. You should see information of the form:

    2016-03-22 20:14:31,249 [  88263]  DEBUG - tellij.builder.ForceComBuilder - Computing the server timezone offset using multiple samples. 
    2016-03-22 20:14:31,746 [  88760]   INFO - tellij.builder.ForceComBuilder - The average server timezone offset for 5 samples is -3921 ms. 
    ...
    2016-03-22 20:15:15,412 [ 132426]  DEBUG - tellij.builder.ForceComBuilder - Comparing local to server timestamps for classes/SomeClass.cls: 
    2016-03-22 20:15:15,412 [ 132426]  DEBUG - tellij.builder.ForceComBuilder -   lastDeployedDate       = Tue Mar 22 20:14:37 CDT 2016 
    2016-03-22 20:15:15,412 [ 132426]  DEBUG - tellij.builder.ForceComBuilder -   serverLastModifiedDate = Tue Mar 22 20:15:04 CDT 2016 
    2016-03-22 20:15:15,412 [ 132426]  DEBUG - tellij.builder.ForceComBuilder -   localLastModifiedDate  = Tue Mar 22 20:15:15 CDT 2016 (raw) 
    2016-03-22 20:15:15,412 [ 132426]  DEBUG - tellij.builder.ForceComBuilder -   localLastModifiedDate  = Tue Mar 22 20:15:11 CDT 2016 (adjusted) 
    2016-03-22 20:15:15,412 [ 132426]  DEBUG - tellij.builder.ForceComBuilder - Local file newer than server representation: classes/SomeClass.cls 
    2016-03-22 20:15:15,412 [ 132426]  DEBUG - tellij.builder.ForceComBuilder - Server file has been modified more recently than last deployment or retrieval and should be merged: classes/SomeClass.cls 
    2016-03-22 20:15:15,527 [ 132541]  DEBUG - tellij.builder.ForceComBuilder - The following files need to be merged: 
    2016-03-22 20:15:15,529 [ 132543]  DEBUG - tellij.builder.ForceComBuilder - classes/SomeClass.cls - last modified by Some User (someuser@somedomain.com) on Tue Mar 22 20:15:04 CDT 2016 
    

    which should tell us exactly how it's seeing the relationship between the server and local files. Please install this build, reproduce the issue, and provide this debug logging info so I can see why it's yielding bogus warnings.

  12. Scott Wells repo owner

    Resolving this hoping that 1.6.9.5 addresses it completely. If it doesn't, feel free to reopen and we'll see what else is needed.

  13. Log in to comment