cap-codepush@2.0.0 fails with "Cannot perform diff-update" on second sequential release to a deployment #3511
If you are looking for help, please confirm the following...
Which mobile framework are you using?Ionic/Cordova Steps to reproduce
Expected resultsUpdate #2 should download and install cleanly, applying the new content on the next restart — the same way update #1 did. Actual resultsInstall fails with: Preceded by these filesystem errors, indicating the plugin is looking for local package state that was never persisted after update #1's "successful" install: This happens on every deployment's second release onward — the first release always installs fine, but the diff chain appears to break immediately after. Workarounds tried (not viable long-term):
Build id (optional)No response |
Replies: 2 comments
|
Hello there, we already have a thread in Pylon chat, but i'll post the response here anyway. The issue seems to happen during the local package handling and this seems like a known bug regarding how the cap-codepush plugin interacts with the @capacitor/filesystem plugin under the hood during a differential update (which happens on the second release and onwards). Since you are on Capacitor 5, if you are able to migrate the project to Capacitor 6 or newer, upgrading to cap-codepush@3 or higher (which includes newer bug fixes and updated @capacitor/filesystem handling) should resolve this specific diff-overwrite limitation. Or you could use a tool like patch-package to add a 'delete file if it exists' logic locally in your node_modules right before file merges execute. |
|
We can fix it via these changes Here's the patch-package documentation for reference. And some examples from the community guide. But these are generally your steps to do; Install the utility: Add a post-install trigger to your package.json: This will make sure that your fix is automatically injected whenever npm install runs Open node_modules/cap-codepush/dist/esm/web.js (or the equivalent compiled bundle file your framework is hitting inside the package directory). Find the location where the plugin interacts with the filesystem. Copy or Filesystem. Rename to move unzipped contents. Right before the copy operation, wrap it with a deletion block so existing files are wiped out instead of forcing an overwrite, so something like this; Run the generation command in your terminal: This should create a /patches directory at your root containing a file like cap-codepush+2.0.0.patch. And don't forget to commit this /patches folder to your Git repository |
Hello there, we already have a thread in Pylon chat, but i'll post the response here anyway.
The issue seems to happen during the local package handling and this seems like a known bug regarding how the cap-codepush plugin interacts with the @capacitor/filesystem plugin under the hood during a differential update (which happens on the second release and onwards).
Since you are on Capacitor 5, if you are able to migrate the project to Capacitor 6 or newer, upgrading to cap-codepush@3 or higher (which includes newer bug fixes and updated @capacitor/filesystem handling) should resolve this specific diff-overwrite limitation. Or you could use a tool like patch-package to add a 'delete file if…