vaimo / composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and composer command for testing/troubleshooting patches.
MIT License
285 stars 40 forks source link

The composer update crashes on plugin upgrade #68

Open allanpaiste opened 3 years ago

allanpaiste commented 3 years ago

This does not happen all the times, but when the amount of changes introduced is large enough and covers things like:

... then it can cause issues where half of the already in-memory classes are from the old plugin and half from the new (depends on when they were loaded by the autoloader)

Pre-requisites

  1. Use any composer version, on any platform
  2. A use Composer project without the plugin

To Reproduce

  1. Install the plugin on 4.0.0
  2. Upgrade the plugin to latest available version

Expected

The plugin either updates and works right away without issues or some notification is shown on the fact that it can't execute within that run.

Actual

The plugin crashes with a call stack that might lead the user to think that it's broken/unusable - no extra guide presented in the output about the fact that new run would actually work a-ok.

Notes

Maybe the way to deal with this would be to just report that the plugin did not run when it detects that it was updated and a guide would be included how to run it manually.

ihor-sviziev commented 3 years ago

I also had similar issues multiple times with the vaimo composer pathces updates. Usually removing whole vendor and running composer install helps, but that's annoying