Skip to content

Google Play retry does not retry bridge.init() #1719

Description

@kgkg

Description

The Google Play adapter appears to have a retry mechanism for initialization failures, but the retry does not actually execute bridge.init() again.

GooglePlayAdapter.initialize() caches its promise:

if (this.initializationPromise)
    return this.initializationPromise;

When bridge.init() fails, initialization schedules another attempt using:

this.retry.retry(() => this.initialize());

However, when the retry calls initialize() again, this.initializationPromise is already set, so the method immediately returns the existing promise instead of calling bridge.init() again.

As a result, the retry mechanism does not perform another initialization attempt.

Steps to reproduce

  1. Make the first call to bridge.init() fail with a retryable initialization error.
  2. Allow the internal retry mechanism to run.
  3. Make bridge.init() succeed if called again.
  4. Count how many times bridge.init() is invoked.

Actual behavior

bridge.init() is called only once.

The retry calls initialize() again, but it returns the already cached initializationPromise.

Expected behavior

A retry should perform another actual call to bridge.init().

For example, the retry could invoke the underlying initialization operation directly instead of calling the memoized initialize() method.

Possible direction

Instead of:

this.retry.retry(() => this.initialize());

the adapter could retry the operation that calls:

this.bridge.init(...)

while keeping the original initialization promise pending until initialization eventually succeeds or reaches a terminal error.

A regression test checking that bridge.init() is called twice after one retryable failure would also make this behavior explicit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions