Skip to content

initTimeoutExpired errors when calling updateUserWithResult immediately after initialize #36

@ehu0716

Description

@ehu0716

Summary

We're seeing a high volume of initTimeoutExpired errors on both Statsig.initialize() and Statsig.updateUserWithResult() when updateUserWithResult is called before initialization completes.

Our Usage Pattern

We initialize the SDK with a placeholder user and then immediately call updateUserWithResult with the real user before the initialization completes:

let options = StatsigOptions(initTimeout: 10)

Statsig.initialize(sdkKey: "client-key", user: placeholderUser, options: options) { error in
    // Sometimes receives .initTimeoutExpired
}

// Called immediately, before initialize completes
Statsig.updateUserWithResult(realUser) { error in
    // Sometimes receives .initTimeoutExpired
}

What We're Seeing

  • initTimeoutExpired on initialize: 69k errors in the past 14 days
  • initTimeoutExpired on updateUserWithResult: 13k errors in the past 14 days
  • initTimeout is set to 10 seconds, which should be more than sufficient
  • Sometimes one call succeeds while the other times out, and vice versa

Expected Behavior

With a 10-second timeout, we would not expect this volume of timeout errors. The error rate suggests something beyond normal network latency is contributing to the timeouts.

Environment

  • Statsig iOS SDK
  • initTimeout: 10 seconds
  • Both calls are made near-simultaneously at app launch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions