Problem:
When deploying code from my local machine to the server, any changes which were saved to the server by another developer which I didn't have locally are overwritten.
Describe the solution you'd like
When deploying changes, it should check for updates on the server and if there are any conflicts then retrieve the files for merging. It would also be nice to be able to retrieve a file for merging with the local version.
Describe alternatives you've considered
Without this feature our company can't use this
See Spec in comment: https://github.com/forcedotcom/salesforcedx-vscode/issues/633#issuecomment-454090714
I assume you are referring to when you use "Deploy to Org", correct? We do check for conflicts when you do a source push to a scratch org.
Hi Nathan, yes sorry this is when using "Deploy to Org". It will be a while before we can convert our project to use dx.
@strotto What IDE do you use today?
Hi @ntotten, currently I am using Intellij with Illuminated Cloud
This also happen with vscode, trying to develop against a standard Developer Org (not a scratch org)
Hi @ntotten any news on where this ticket lives in your backlog?
Checking for conflicts/changes before deploying, is the the only thing stopping my teams from dropping MavensMate in VS Code and moving to the Salesforce Extensions for VS Code.
Can anyone confirm if this will be part of the spring '19 release? Also a huge blocker for our organization's switch to this plugin
We don't ship VS Code in the same cycle of core - we ship every week. The aim is to have this sometime in the next few months.
Thanks for the update @ntotten!
Standing by and awaiting eagerly :)
Recording the spec here for feedback.
When a user deploys metadata to the org, VS Code should check to ensure that the local metadata changes won't silently overwrite changes on the org. Conversly, when a user retrieves metadata from an org conflicts with the local source should be checked as well to ensure local changes wont be overwritten.
Because we don't have full source tracking on non-scratch orgs, the comparison should rely solely on the update times or other similar means. It should not require pulling the full source and doing a compare as that is going to take a very long time. We need to figure out a good enough approach for doing the comparison that is also fast.
The results will be that when a deployment is executed one of the following will happen:
The warning will provide users with the following information for each potential conflict:
For the initial release of this feature, we will simply detect the conflict and not execute the deployment. The user will be informed that they can proceed with the deployment by forcing the deployment via the CLI sfdx force:source:deploy/retrieve ... --force. The warning will display the entire command they will need to execute (this is the same command we would have executed via VS Code only with the --force flag added).
In subsequent versions of this feature, we will provide the ability for users to do local comparisons and diffs of the metadata. This will be documented separately.
This also should be optionally disabled by a configuration setting.
See the Force.com IDE documentation for how this situation was handled there. The expectation is that the functionality will be similar in VS Code. https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/ide_pro_synch_with_server.htm
Exactly what we'd look at for an MVP. I can at least speak for our teams, and we can get by without the diff, at least initially. This would allow us to migrate from Eclipse to VS Code.
That last bit (about file diffs) would complete the requirement, but we can find our way around and do that ourselves in the interim.
Interested in this feature
Any updates here? Being able to run diffs on save/deploy would be great, but a manual diff could suffice as well.
I am currently using Illuminated Cloud, which offers conflict check prior to pushing changes, and some other team members are using VSCode for sandbox development. Folks using VSCode have overwritten others changes on occasion because something was modified and a pull was not done before developing. #frustrating
I am very much looking forward to this feature! 👍
I need this !
from japan.
We need this as well.
Currently we are using ForceCode extension for VScode which do the same and gives a warning pop-up on conflict but would be great if we can do it directly through SFDX plugins.
@ntotten Do you have an update on this issue? Developers overwriting each other's work is a big headache in our org as well.
I am ready to stop getting messages like the one I got today:
Can you re-deploy your cancelOrder component to CPQBox? I am afraid I overwrote your changes.
We are actively working on this. Unfortunately, due to some decisions that were made a long time ago, this isn't super straight forward. I am hoping we will be able to ship this by August, but that isn't for sure.
Chiming in on this, would be great to have. I have had to stop using SFDX for this and went back to Mavensmate. Waiting for it being released :)
This is very unfortunate news that it will be delayed possibly indefinitely. It is pushing developers toward having to use paid products and not support this plugin
@riotmakerr - Did someone say it would be delayed indefinitely?
I had not heard that - can you point to where you saw this reference?
The note above says it is actively being worked on, but will take some work to sort out.
@riotmakerr @paustint It is not being delayed indefinitely. We are actively working on it. Not sure where that information came from but it is not accurate.
This was opened in Sep 2018, promised to be in "the next few months" in Jan, was then removed from the GA milestone, and now "isn't for sure" to be shipped by any particular date.
My apologies for assuming that information meant this isn't going to be delivered. But I shouldn't have to read between the lines
@riotmakerr The milestone was removed because we stopped using github milestones.
Thanks @ntotten for the updates on this issue, and keep up the good work on the VS Code SFDX stuff. Exciting to see active work going on to add/improve the SFDX tools.
Subbed and staying tuned for updates on this. The 'Check for conflicts' feature would be amazing. Thanks.
"The check for conflicks" is a must.
Wondering Salesforce is "forcing" us to use "Package Development" instead of "Org Development" (which also fits many times in small devs, reducing its complexity)
https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model
Any update on this one as overwriting each others code is a huge issue in our org as well. thanks
I think this is a must! It was one of the best and most useful features MavensMate had!
I know it's not the best scenario for more than one dev working on the same environment, but realistically speaking, you know it happens and we need a way to prevent overwriting each others work.
Having to retrieve every now and then, "just to be safe" it's not convenient.
Having to use the diff plugin before deploying it's not convenient either because in that case we can't use the "deploy on save" option.
Guys! This VsCode extension allows diff checking on save. The link is https://marketplace.visualstudio.com/items?itemName=MohithShrivastava.dx-code-companion . It is not enabled by default, so read the full extension description for how to activate it. I've used it extensively and it definitely prevents overwrites.
@plinderman very nice. Thanks for the share.
Hi. Any update on this issue. We would really like to have this feature so as not to override each others code.
Hey @ntotten! Any news about this feature? Really looking forward to have it... Thanks.
Hi @ntotten, It would be great having an update on this. Thank you very much.
Hi Everyone - Our first iteration of this feature is now live. Check out the details in our [documentation] (https://developer.salesforce.com/tools/vscode/en/user-guide/detect-conflicts). We’d like your input on the next iteration - please review the spec & add comments there with any feedback. Closing this issue to consolidate the conversation to one place.
@smaddox-sf , I just test the conflicting feature but alas it's still not working. I follow the same steps as it is given in links. File->Preferences->Setting Extension-> Salesforce Feature Preview.Checked the checkbox 'Detect conflict at sync. Please check the attached screenshot of the setting. Please let me know if I missed any steps.

The same conflict feature is working properly in The Welkin Suite editor. Due to only this feature company is using this editor.
I also could never get the conflict detection to work. But due to performance issues I have deemed the VS Code extensions unusable and will stick to Intellij
Hi @neelxkamal - Thanks for raising this. What Deploy / Retrieve commands are you using? This feature is currently only enabled for deploy / retrieve with manifests. (We'll be expanding it soon.)
@strotto - I'd love more info on what commands you were seeking to use as well for Conflict Detection. Regarding performance, are you referring to slowness with deploy / retrieve or other areas? I'm glad you have an IDE that's working for you, but would also like to hear your input on performance.
hi @smaddox-sf,
I wasn't using the deploy/retrieve with manifests, I was right clicking on the open class and clicking on 'SFDX: Deploy This Source to Org".
In terms of performance, the most notable issue was intellisense was taking 6+ seconds to show. Though I will try using VS Code today in an attempt to give you better feedback. Also retrieving objects from an org takes a very long time, usually at least 10 minutes.
Hi @strotto - OK. Conflict Detection is only available for manifests right now. We have work in flight to enable it for the other Deploy / Retrieve commands. (We're also working on a better experiences to see the diffs - check out the spec here, if you want to check it out and give feedback).
Thanks for the input on performance. We are investigating the autocomplete performance (under this issue) How large is your project? Others are reporting good performance on small projects, noticeable lag on big projects. Curious to know if that is your experience as well.
We also have active work in flight to increase performance on retrieves and deploys. We'll have more to share on that as we complete & release the improvements
Thanks smaddox-sf.
sorry for the late reply. Many developers are working on one sandbox so we
can use the 'deploy with Manifest ' .
Waiting for this feature to available with all deploy commands.
Thanks
Neel Kamal
On Thu, Apr 2, 2020 at 2:10 PM smaddox-sf notifications@github.com wrote:
Hi @strotto https://github.com/strotto - OK. Conflict Detection is
only available for manifests right now. We have work in flight to
enable it for the other Deploy / Retrieve commands. (We're also working on
a better experiences to see the diffs - check out the spec here
https://github.com/forcedotcom/salesforcedx-vscode/issues/2034, if you
want to check it out and give feedback).Thanks for the input on performance. We are investigating the autocomplete
performance (under this issue
https://github.com/forcedotcom/salesforcedx-vscode/issues/2095) How
large is your project? Others are reporting good performance on small
projects, noticeable lag on big projects. Curious to know if that is your
experience as well.We also have active work in flight to increase performance on retrieves
and deploys. We'll have more to share on that as we complete & release the
improvements—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/forcedotcom/salesforcedx-vscode/issues/971#issuecomment-608019436,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEBJB3LUO4G7QVAC6OMXWXLRKTIIHANCNFSM4GSZ5FEA
.
--
Neel Kamal
hi @smaddox-sf, we have ~850 classes, ~700 objects and our apex usage is at ~65% so it is a reasonable size. When I set up VS Code with a new environment I found that the auto-complete performance was fine until I refreshed the SObject Definitions, then it suddenly became unusable.
Thanks for the additional info @strotto !
hi @smaddox-sf tried out this beta feature but not getting it to work. I'm running sfdx force:source:retrieve -x

This is a valuable feature to get our team to resolve conflicts before deploying or retrieving if they're updating local classes.
Anything I'm missing? Thank you!
Hi @salomonzapata - I'm glad this feature will be valuable to your team! Right now, this feature is ONLY available when working with manifests. Were you using a Deploy or Retrieve manifest command when it didn't work?
We have work in flight to enable it for the other Deploy / Retrieve commands. (We're also working on a better experiences to see the diffs - check out the spec here, if you want to check it out and give feedback).
HI @smaddox-sf indeed, the command i ran used pointed to the path in my local to the manifest / package.xml. However it still didn't work even though there were discrepancies between some apex classes between org and local. I was only running a retrieve command.
Thanks for confirming @salomonzapata. It should show you any differences (except new files). Can you open a new issue with the details of what you experienced so we can check into it?
Is this still not available for 'deploy/retrieve this source from org' ??
Nope, they only implemented it for deploy via manifest which is not very useful
Hi @AmrutHunashyal and @strotto - Diff Detection is coming for the rest of the Deploy / Retrieve commands. Check out the spec and feel free to comment there with any feedback. We'll be coming back to this work in a couple months. This feature is taking awhile to complete and we paused the work on Diff Detection to do some other foundational work to make deploys & retrieves faster. This will help us deliver a performant experience for Diff Detection.
Most helpful comment
Recording the spec here for feedback.
When a user deploys metadata to the org, VS Code should check to ensure that the local metadata changes won't silently overwrite changes on the org. Conversly, when a user retrieves metadata from an org conflicts with the local source should be checked as well to ensure local changes wont be overwritten.
Because we don't have full source tracking on non-scratch orgs, the comparison should rely solely on the update times or other similar means. It should not require pulling the full source and doing a compare as that is going to take a very long time. We need to figure out a good enough approach for doing the comparison that is also fast.
The results will be that when a deployment is executed one of the following will happen:
The warning will provide users with the following information for each potential conflict:
For the initial release of this feature, we will simply detect the conflict and not execute the deployment. The user will be informed that they can proceed with the deployment by forcing the deployment via the CLI
sfdx force:source:deploy/retrieve ... --force. The warning will display the entire command they will need to execute (this is the same command we would have executed via VS Code only with the--forceflag added).In subsequent versions of this feature, we will provide the ability for users to do local comparisons and diffs of the metadata. This will be documented separately.
This also should be optionally disabled by a configuration setting.
See the Force.com IDE documentation for how this situation was handled there. The expectation is that the functionality will be similar in VS Code. https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/ide_pro_synch_with_server.htm