This repository was archived by the owner on May 20, 2025. It is now read-only.
add(SyncOptions): add type ignoreFailedUpdates #2803
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
syncOptions
object can haveignoreFailedUpdates
option but not specified inSyncOptions
type definition.Make
ignoreFailedUpdates
option publicBackground
Currently, CodePush has internal logic to ignore failed updates, controlled by
ignoreFailedUpdates
which defaults totrue
. While there is arollbackRetryOptions
to control retry attempts, this approach has limitations.Problem
In some applications, especially those with tight frontend-backend coupling, rolling back may not be a viable option. When the backend API changes, older versions of the app may not function properly.
(in my case, we only managed latest backend and frontend in 1:1 relationship, so rolledback wasn't the answer to recover)
Some update failures occur due to temporary issues (network instability, device state, etc.) rather than problems with the update itself. In these cases, permanently ignoring the update is overly restrictive.
Current workaround of setting very high
maxRetryAttempts
inrollbackRetryOptions
to effectively "never ignore" updates is:Solution
Make
ignoreFailedUpdates
option public in the type definitions, allowing developers to explicitly set it tofalse
when they want to continue attempting updates regardless of previous failures.This provides:
ignoreFailedUpdates: false
directly communicates "keep trying failed updates"Real-world Use Case
In our production environment with hundreds of mobile devices, we occasionally see updates fail on some devices due to temporary issues. With
ignoreFailedUpdates: true
, these devices become stuck on older versions even though the update itself is valid. By settingignoreFailedUpdates: false
, we ensure all devices eventually receive critical updates.Impact
This change only exposes an existing option - it doesn't modify the default behavior, so existing applications won't be affected unless they explicitly opt in.
Note
Previously, when Microsoft operated the CodePush server,
ignoreFailedUpdates
was kept internal to prevent unnecessary server load from retry attempts. However, now that CodePush requires self-hosted servers, it makes more sense to expose this existing property and let implementers decide how to handle update retries based on their own infrastructure and needs.