force:source:push source tracking does not work if you modify file during push
Summary
If you call force:source:push command it will automatically pick up files that were changed and deploy them to your scratch org. However, if you change these files again during that push and then call force:source:push again after previous execution is completed it will say "No results found". Doing the same with force:source:legacy:push detects the changes that were made to the files during previous push.
Steps To Reproduce:
- Modify any file in your repository.
- Call force:source:push
- When your changes are pushed to the scratch org modify that file again
- Call force:source:push again
Expected result
Most recent changes are deployed to the scratch org
Actual result
Push returns "No results found" message.
System Information
{
"cliVersion": "sfdx-cli/7.147.1",
"architecture": "darwin-x64",
"nodeVersion": "node-v16.14.2",
"pluginVersions": [
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.3.1 (core)",
"@oclif/plugin-not-found 1.2.6 (core)",
"@oclif/plugin-plugins 1.10.11 (core)",
"@oclif/plugin-update 1.5.0 (core)",
"@oclif/plugin-warn-if-update-available 1.7.3 (core)",
"@oclif/plugin-which 1.0.4 (core)",
"@salesforce/lwc-dev-server 2.11.0",
"@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
"alias 2.0.0 (core)",
"apex 0.11.0 (core)",
"auth 2.0.1 (core)",
"community 1.1.4 (core)",
"config 1.3.30 (core)",
"custom-metadata 1.0.12 (core)",
"data 0.6.13 (core)",
"generator 1.2.2 (core)",
"info 2.0.0 (core)",
"limits 2.0.0 (core)",
"org 1.11.2 (core)",
"salesforce-alm 54.2.0 (core)",
"schema 2.0.0 (core)",
"sfdx-cli 7.147.1 (core)",
"signups 1.0.0 (core)",
"source 1.9.3 (core)",
"telemetry 1.4.0 (core)",
"templates 54.3.0 (core)",
"trust 1.1.0 (core)",
"user 1.7.1 (core)"
],
"osVersion": "Darwin 21.3.0"
}
Additional information
Without this working correctly we are basically blocked from doing any work during push as it won't be picked up by the next execution of the command.
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
my first reaction is, "don't do that" (modifying the files while the push is in progress).
Why are you doing that?
It's pretty often that you make a change (Apex, LWC, VF, whatnot), push the change and then realize there was a minor logic error or something and make the fix before the push has finished. Especially if you're using an IDE that automatically pushes each time you save.
If what @filiprafalowicz says is true, I can see this causing all sorts of aggravation and reports of unexpected behavior.
This happens to me all the time, mostly because my push is slow, a 30 seconds minimum. More often a minute+. Rather than waiting for it I'll continue making changes or work on another area of the file than what I was just about to test in the org.
I think this issue has been fixed recently as I am no longer seeing it.