@@ -204,7 +204,7 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter
204204 this . configOnDisk = new Lazy < any > ( ( ) => this . loadUpdateConfig ( ) )
205205 }
206206
207- protected _isUpdateSupported : VerifyUpdateSupport = ( updateInfo : UpdateInfo ) : boolean | Promise < boolean > => this . checkIfUpdateSupported ( updateInfo )
207+ protected _isUpdateSupported : VerifyUpdateSupport = updateInfo => this . checkIfUpdateSupported ( updateInfo )
208208
209209 /**
210210 * Allows developer to override default logic for determining if an update is supported.
@@ -220,6 +220,23 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter
220220 }
221221 }
222222
223+ protected _isUserWithinRollout : VerifyUpdateSupport = updateInfo => this . isStagingMatch ( updateInfo )
224+
225+ /**
226+ * Allows developer to override default logic for determining if the user is below the rollout threshold.
227+ * The default logic compares the staging percentage with numerical representation of user ID.
228+ * An override can define custom logic, or bypass it if needed.
229+ */
230+ get isUserWithinRollout ( ) : VerifyUpdateSupport {
231+ return this . _isUserWithinRollout
232+ }
233+
234+ set isUserWithinRollout ( value : VerifyUpdateSupport ) {
235+ if ( value ) {
236+ this . _isUserWithinRollout = value
237+ }
238+ }
239+
223240 private clientPromise : Promise < Provider < any > > | null = null
224241
225242 protected readonly stagingUserIdPromise = new Lazy < string > ( ( ) => this . getOrCreateStagingUserId ( ) )
@@ -417,8 +434,8 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter
417434 return false
418435 }
419436
420- const isStagingMatch = await this . isStagingMatch ( updateInfo )
421- if ( ! isStagingMatch ) {
437+ const isUserWithinRollout = await Promise . resolve ( this . isUserWithinRollout ( updateInfo ) )
438+ if ( ! isUserWithinRollout ) {
422439 return false
423440 }
424441
0 commit comments