forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
953 stars 405 forks source link

SFDC Extension deploys single file changes to scratch org quickly, but local Extension process takes much longer to complete than the actual metadata deployment #5121

Closed ImJohnMDaniel closed 1 year ago

ImJohnMDaniel commented 1 year ago

Summary

I am seeing behavior where I will edit a file in VSCode, typically an Apex class, save those changes in the file, VSCode SFDC Extension then automatically deploys the change to the scratch org. The Deployment Status window in the scratch org shows that the change happens successfully within in a second but VSCode status pop-up is still spinning. That will last between 20 seconds to as much as 3-4 minutes. If I make subsequent changes to the same or different files, the same behavior is observed and I actually see VSCode stacking the various deployment bubbles on the right hand side.

FWIW, I am using the latest VSCode SFDC extension and I am running the latest nightly CLI build

Interesting. If there is a compilation error when the save occurs, that feedback shows in the VSCode Salesforce CLI Output channel very quickly but the operation is still going.

It has been suggested to me that this might have something to do with the SDR's behavior of waiting for a SourceMember record to be written before allowing the “push” command to resolve.

Clearly I need to discover more information about this behavior in order to help your team with the diagnosis. My question would be what is the best way to help investigate this issue? What are some bits of information that I can look for to help give you get clues as to what is the “crimp in the hourglass” with this issue??

Steps To Reproduce:

Unclear as of this moment. Still working to reproduce consistently. Will advise when I can.

Additional information

Feel free to attach a screenshot.

Salesforce Extension Version in VS Code: Salesforce Extension Pack v58.15.0

SF CLI Version: @salesforce/cli/2.11.1 darwin-x64 node-v18.15.0

OS and version: MacOS v13.6

VS Code version: v1.82.2

CristiCanizales commented 1 year ago

Hi @ImJohnMDaniel, thank you for all the details. We currently have #4865 issue open and are working on a fix (#5117) for the slow deployment, and it's related to source tracking. I'll close this issue to keep track of the problem there!

ImJohnMDaniel commented 1 year ago

Thanks for the update @CristiCanizales. I appreciate it. Cheers!