code-push
code-push copied to clipboard
fix: Mandatory flag wasn't set correctly on promote
If isMandatory is set to false during a promote and the source deployment has isMandatory as true, the resultant deployment will have isMandatory set to true because of the way the check was implemented.
This PR fixes that behaviour and ensures the right flag is set.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/code-push/utils/adapter/adapter.js b/node_modules/code-push/utils/adapter/adapter.js
index 93507cb..8c0c93f 100644
--- a/node_modules/code-push/utils/adapter/adapter.js
+++ b/node_modules/code-push/utils/adapter/adapter.js
@@ -337,7 +337,7 @@ var Adapter = /** @class */ (function () {
releaseUpload.description = updateMetadata.description;
if (updateMetadata.isDisabled)
releaseUpload.disabled = updateMetadata.isDisabled;
- if (updateMetadata.isMandatory)
+ if (typeof updateMetadata.isMandatory !== 'undefined')
releaseUpload.mandatory = updateMetadata.isMandatory;
if (updateMetadata.rollout)
releaseUpload.rollout = updateMetadata.rollout;
This issue body was partially generated by patch-package.