IDEA deploying and overwritting code on orgs

Issue #416 resolved
Matej Pinter created an issue

I don't know if I have something wrong set or something else, but reported from many of my coworkers it seems my IDEA is somehow automatically deploying code to orgs before asking for conflict or anything so it has overwritten code from others.

Today I saw this in action. In browser I edited one class and saved it, but I had old copy in my IDEA. When I opened IDEA I went for few minutes away and when I came back there was a problem message for fail deployment (I got error in my code in IDEA) so somehow IDEA automatically tried to deploy class and not even asking for conflict as code on server was different than code in IDEA.

If this is a bug then I'm setting this as blocker as my team will probably prohibit using IDEA in future if it is going to overwrite code. We have lost few days of work now :(

Comments (7)

  1. Scott Wells repo owner

    Matej, I'm very sorry to hear this happened. The absolute last thing I'd want is to play a role in loss of work/progress. IC does feature conflict detection that is enabled on a per-connection basis. Do you have this enabled for the active connection? The setting is immediately beneath the username/password/token fields in the connection configuration screen. If each developer is using distinct login credentials, select Dedicated Logins, and if developers are sharing login credentials, select Shared Logins. If you've already done this, can you reproduce this and send me the idea.log with the following enabled in Help>Debug log settings so that I can see what's going on?

    #com.illuminatedcloud.intellij.builder.ForceComBuilder
    #com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer
    #com.illuminatedcloud.intellij.builder.ForceComToolingApiDeployer
    

    Again, I sincerely apologize for the loss of progress.

  2. Matej Pinter reporter

    Hi,

    we use same admin login credentials so I should use shared login? Even if I set this, I think IDEA shouldn't upload files automatically. As I wrote I restarted IDEA, and went to my coworker where we fixed code in browser and when I came back I got error message that class couldn't be uploaded, so IDEA tried to upload this class again without me pressing any save.

    I will switch to shared login setting and I will observe this more. Luckily we have code in git as well, but only nightly builds, so we can only lose the work of same day.

  3. Scott Wells repo owner

    Matej, you'd choose Dedicated vs. Shared based on whether users are developing using completely distinct credentials (admin or otherwise) or shared credentials respectively. Even if you're an admin, as long as other users are logging in with their own credentials, you'll want to use Dedicated.

    As for the IDE uploading files automatically, let me explain...by default Illuminated Cloud deploys on save. In IDEA (not just Illuminated Cloud), saves can occur even when you don't explicitly type the keyboard shortcut or press the toolbar button. By default it saves when the IDE window loses focus and potentially every few minutes. You can disable these behaviors in IDEA, and you can also tell Illuminated Cloud not to deploy on save at all, instead requiring you to perform a Force Save, Deploy Modified, or Deploy All to upload.

    If you're not sure where to find these settings, let me know and I'll provide detailed pointers.

  4. Scott Wells repo owner

    Resolving this for now. If it turns out you're seeing overwrites even when conflict detection is enabled, please feel free to reopen.

  5. Scott Wells repo owner

    Matej, here's where you can find the IDEA-level settings that control auto-save (and therefore deploy-on-save when enabled):

    AutoSaveSettings.png

  6. Matej Pinter reporter

    Ok thanks, I will be testing this new settings now for few days. Good luck @Dreamforce :)

  7. Log in to comment