Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Detect Conflict At Sync" doesn't work #3522

Closed
darioms21 opened this issue Aug 30, 2021 · 16 comments
Closed

"Detect Conflict At Sync" doesn't work #3522

darioms21 opened this issue Aug 30, 2021 · 16 comments

Comments

@darioms21
Copy link

darioms21 commented Aug 30, 2021

Summary

Click on "SFDX: Deploy Source in Manifest to Org" on Packaged ("salesforcedx-vscode-core.detectConflictsAtSync": true); The conflict start and run success aleatory.

Steps To Reproduce:

  1. Enable "Salesforcedx-vscode-core: Detect Conflicts At Sync".
  2. Change metadata.
  3. Click "SFDX: Deploy Source in Manifest to Org" on Packaged.
  4. Running "SFDX: Deploy Source in Manifest to Org" does not always fail.

Expected result

Always that Enable "Salesforcedx-vscode-core: Detect Conflicts At Sync". Should run the conflict and when there are conflicts show a alert to view the conflict or override the source.

Actual result

The confict never correctly executed. Only occasionally in action Deploy but not always.

Additional information

image
image
image
image
The Conflict Detection doesn't detect my change in the title of the component for example.

Salesforce Extension Version in VS Code:
v52.8.0

SFDX CLI Version:
sfdx-cli/7.110.0 win32-x64 node-v14.17.3

OS and version:
OS: Windows 10 Enterprise
Version: 1909

@PawelWozniak
Copy link
Contributor

I also experienced issues with conflict detection. First I have pushed metadata from the local computer to scratch org then on each save of class I was notified that there is a conflict with the version on org. But no changes were done there, I am the only user o this scratch org.
Also when I selected to overwrite changes on org the next save also displayed a notification about conflict.
Finally, I deactivated that because is getting many false positive alarms.
Diff file against org shows that there were no changes on org.

@uip-robot-zz
Copy link

This issue has been linked to a new work item: W-9873036

@PawelWozniak
Copy link
Contributor

It might be related to this isue forcedotcom/cli#1178 .
It seems to be similar that force:source:status show files that were just saved to SF as conflict and conflict detection is also alarming about those files.

The main issue is that file that was just saved to SF somehow is modified on SF servers and appears as changed.
However, as described in the other bug report pulling those files to the local file system doesn't indicate any changes.

@ralphcallaway
Copy link

@PawelWozniak the order that stuff happens

  • file saved locally
  • deployment!!
  • file saved remotely

Except in the best cases the time it takes to actually deploy means the local file modified date will always be before the remove file modified date, even though they were changed at the same time. Wooops!

See #3542

@PawelWozniak
Copy link
Contributor

@ralphcallaway Good that we know at least what is the source of the issue. Maybe it could be replaced by generating a hash of the file on the local and server-side and comparing those hashes.

@trinasfdx trinasfdx added the status:in review pr/issue is being reviewed label Apr 1, 2022
@floralan
Copy link
Contributor

floralan commented Apr 1, 2022

@darioms21 This issue has been resolved here #3556. Could you verify it has been fixed in our latest release?

@floralan floralan added more information required and removed status:in review pr/issue is being reviewed labels Apr 1, 2022
@floralan floralan removed their assignment Apr 1, 2022
@floralan floralan closed this as completed Apr 1, 2022
@ogomezba
Copy link

ogomezba commented Apr 5, 2022

@darioms21 This issue has been resolved here #3556. Could you verify it has been fixed in our latest release?

Hi @floralan,

I've done some checks and I think that the issue reported in #3542 (which was closed in favour of this issue) is still there. I'm not sure if I need to do any additional steps or enable something but if I follow the steps mentioned in #3542, I still reproduce the same error regarding conflict detection (as explained by @ralphcallaway):

Steps To Reproduce:

Open SomeClass.cls
Run the "SFDX: Retrieve this Source from Org" command
Make a change to SomeClass.cls and save
Make a second change and save

Expected result

Both saves should go through since the version of the class prior to the change is up to date.

Actual result

The first change after doing a retrieve goes through without throwing a conflict error. The second change throws a conflict error.

@PawelWozniak
Copy link
Contributor

I can confirm this.
I have:

  1. Updated SFDX to sfdx-cli/7.144.2 win32-x64 node-v16.14.2
  2. Reset source tracking with force:source:tracking:reset (and legacy reset as format of source tracking is changed as described here)
  3. Enabled "Detect conflict at sync" after updating sfdx

And still on every save of file I am getting warning:
2022-04-07_09h20_19

Reproduce:

  1. Make changes in code.
  2. Click override to force save your changes. You expect at this moment that files have the same version.
  3. Add a line of code and save.
  4. You get the same popup that file have conflicts.
  5. Click "View Conflicts and Cancel deploy"
  6. See that new line is a conflict.

2022-04-07_09h23_58

Also after clicking override whole saving process is significantly longer than without "Detect conflict at sync" active.

sfdx-cli/7.144.2 win32-x64 node-v16.14.2
VSCode: 1.66,
SF plugin: v54.7.0

@ralphcallaway
Copy link

please reopen

this is a bit frustrating since you a) have multiple working examples of this (force.com ide, mavensmate) the later is open source and b) there have been repeated explanations that you can't use the "local" file save time as the last modified time, you need to use the "remote" file completed saving and mark that as the "local" file save time (either by touching the file or retrieving it, or getting into a basic db tracking).

You have working prototypes in mavensmates, please make sure you're devs review this. Right now I have my whole team turning this off which sucks because people are overriding each others stuff and it's caused multiple deployment issues (woops, the apex in my vs code isn't wants in the change set, huh???).

It's been years you've been working on a very basic feature with tons of community support the whole time. Frankly it's embarassing for Salesforce. I know this is kind of "open source", but I don't think you get that excuse when it's a tool for a commercial product. You've gone through three iterations so far. Please, please, please, please 1) prioritize fixing this!!!! and 2) fix it properly. Feel free to reach out to me if you need guidance.

@ralphcallaway
Copy link

@floralan plesea re-open so this can get visibility

@ralphcallaway
Copy link

@smaddox-sf can you assist in re-opening this perennial misbehaving feature

@AnanyaJha
Copy link
Collaborator

Hi @ralphcallaway checking in to see if you're still experiencing this issue?

@ogomezba
Copy link

ogomezba commented Dec 9, 2022

Hi @AnanyaJha,

I just checked a few minutes ago and the issue is still there. Once the option is enabled (Detect Conflicts At Sync), every time I try to deploy a new version of the file it is always detected as a conflict.

@AnanyaJha
Copy link
Collaborator

Hi @ogomezba ! Thanks for reaching out - could you open up a new issue with more details on the problem you're facing and what version of the Salesforce Extensions you're using? We'll have the team take a look at your issue, thank you!

@ralphcallaway
Copy link

@AnanyaJha i've got copious details already available in #3542

i really appreciate the follow up. this has felt a bit ridiculous. I worked on this exact same feature with maven's mate (precursor to vs code extension), and documented how to do this correctly in #2034. when it wasn't done correctly i documented it again in #3542. each time the tickets get closed without anything actually getting fixed. it's painful given the exact solution is already outlined for engineering. this feature has been released twice now over two years, and still remains completely unusable :(

@ralphcallaway
Copy link

@AnanyaJha created a new one, see #4585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants