Skip to content

chore: migrate to LDClient.init timeout variant#14

Open
kinyoklion wants to merge 1 commit into
mainfrom
devin/1783329109-update-android-sdk-init
Open

chore: migrate to LDClient.init timeout variant#14
kinyoklion wants to merge 1 commit into
mainfrom
devin/1783329109-update-android-sdk-init

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

The example already targets the latest stable com.launchdarkly:launchdarkly-android-client-sdk (5.13.1, latest on Maven Central), so no version bump was needed. The only change is migrating away from a deprecated SDK API:

LDClient.init(app, config, context) (3-arg, returns Future<LDClient>) is @Deprecated in the current SDK — initializing without a timeout is no longer recommended. Migrated to the documented replacement init(Application, LDConfig, LDContext, int startWaitSeconds):

- LDClient.init(this, ldConfig, context);
+ LDClient.init(this, ldConfig, context, 5); // wait up to 5s for initialization

No other deprecated SDK APIs are in use (LDClient.get, boolVariation, registerFeatureFlagListener, flush, LDConfig.Builder(AutoEnvAttributes), LDContext.builder).

Verification

./gradlew :app:assembleDebug compiles cleanly against SDK 5.13.1. I was also able to boot a headless Android 34 emulator on this Linux VM and run the app: it initialized the client and displayed Feature flag 'my-boolean-flag' is false, confirming the new init call works at runtime.

app running

The "Process/System UI isn't responding" dialog is an emulator SystemUI ANR under software rendering (swiftshader), unrelated to the app — the app UI (title hello-android, flag evaluation text) renders correctly behind it.

Notes

  • No README changes needed (it does not reference an SDK version or platform requirement that changed).
  • No secrets committed; the mobile key used for the runtime test was injected only into the uncommitted working tree and reverted.

Link to Devin session: https://app.devin.ai/sessions/c3b6a36dd8f2496580fc709886c15915
Requested by: @kinyoklion


Note

Low Risk
Single-line SDK API migration in the sample app’s startup path; no auth, data, or dependency version changes.

Overview
Replaces the deprecated three-argument LDClient.init in MainApplication with the SDK-recommended overload that passes 5 as startWaitSeconds, so app startup can block briefly while the client fetches fresh flag values.

Inline comments document that initialization may time out after five seconds while the client remains usable with cached values.

Reviewed by Cursor Bugbot for commit 8b4cfd4. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion kinyoklion self-assigned this Jul 6, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Contributor

@cursor review

@kinyoklion kinyoklion marked this pull request as ready for review July 6, 2026 18:22
@kinyoklion kinyoklion requested a review from a team as a code owner July 6, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant