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

Correctly resolve promises when package type changes #10076

Merged
merged 1 commit into from Aug 29, 2021
Merged

Correctly resolve promises when package type changes #10076

merged 1 commit into from Aug 29, 2021

Conversation

aschempp
Copy link
Contributor

@aschempp aschempp commented Aug 25, 2021

This fixes #10069

When the type of a package changes, Composer does an uninstall and install instead of an update. 78d7792 added support for handling promises of the installer, but because it returns the uninstall promise instead of the resulting install promise, the cleanup operation in https://github.com/composer/composer/blob/master/src/Composer/Installer/InstallationManager.php#L420 runs before install is executed.


FYI instead of setting $promise = $promise->then(…) we could also just return $promise->then(…)

@cmodijk
Copy link
Contributor

cmodijk commented Aug 26, 2021

I just tried the fix @aschempp supplied and this indeed solved the problem #10069

aschempp added a commit to contao/contao-manager that referenced this pull request Aug 27, 2021
@Seldaek Seldaek added this to the 2.1 milestone Aug 29, 2021
@Seldaek Seldaek added the Bug label Aug 29, 2021
@Seldaek Seldaek merged commit 8559279 into composer:master Aug 29, 2021
@Seldaek
Copy link
Member

Seldaek commented Aug 29, 2021

Thanks!

@aschempp aschempp deleted the bugfix/package-type-update branch August 29, 2021 16:30
@jnaklaas
Copy link

Can I test this, I've got the same bug when extracting my latest private packages? Tried to composer self-update master but that didn't work.

@Toflar
Copy link
Contributor

Toflar commented Sep 13, 2021

You can update to the snapchot channel using composer selfupdate --snapshot.

@jnaklaas
Copy link

Okay thanks. Tried that, the issue didn't get resolved though. I also noticed it's not exactly the same bug.

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

Successfully merging this pull request may close these issues.

Failed to extract ZIP
5 participants