composer-patches icon indicating copy to clipboard operation
composer-patches copied to clipboard

patch:undo command resets applied patches info, but does not undo the changes

Open artemmikhalitsin opened this issue 4 years ago • 0 comments

Using the command patch:undo does not undo the changes done to files in the vendor folder. When subsequently running patch:apply, receive an error that the patch is already applied.

Pre-requisites This is based on an installation of Magento 2.3.0 and composter-patches 4.20.2 patches.json file:

{
    "magento/product-enterprise-edition": {
        "[MDVA-1400] Unable to send the cookie; Maximum number of cookies would be exceeded": {
            "source": {
                "2.0.* || 2.1.0 - 2.1.17 || 2.2.0 - 2.2.3": "https://magentopatches.com/2.2/MDVA-1400_2.0_COMPOSER_v1.patch",
                "2.2.4 - 2.2.11 || 2.3.0 - 2.3.4": "https://magentopatches.com/2.2/MDVA-1400_2.0_v1.patch"
            }
        }
    }
}

patch file:

From 3776a9196ba858da9b51ea745f13aa2f61faaa58 Mon Sep 17 00:00:00 2001
From: Ivan Novykov <[email protected]>
Date: Mon, 7 Nov 2016 21:30:22 +0200
Subject: [PATCH] MDVA-1400: [Magento Cloud] - Regular 503 errors on production

---
 vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php       | 2 +-
 1 files changed, 1 insertions(+), 2 1eletions(-)

diff --git a/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php b/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php
index 0463fd8..ce5e5d8 100644
--- a/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php
+++ b/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php
@@ -29,7 +29,7 @@ class PhpCookieManager implements CookieManagerInterface
      * RFC 2109 - Page 15
      * http://www.ietf.org/rfc/rfc6265.txt
      */
-    const MAX_NUM_COOKIES = 50;
+    const MAX_NUM_COOKIES = 200;
     const MAX_COOKIE_SIZE = 4096;
     const EXPIRE_NOW_TIME = 1;
     const EXPIRE_AT_END_OF_SESSION_TIME = 0;

To Reproduce Steps to reproduce the behavior:

  1. Have the above configuration
  2. Run composer patch:apply (or have it automatically applied as part of composer install)
  3. Run composer patch:undo
  4. Run composer patch:apply

Expected All patches are reverted and re-applied

Actual Patch info is reset, but changes are not revered

Notes As we are supporting several clients on different Magento versions, we are trying to maintain a single list of patches and apply patches based on the version of magento/product-enterprise-edition

artemmikhalitsin avatar Feb 26 '20 21:02 artemmikhalitsin