Repository navigation
fix: Remove java.time.Duration usage from FDv2 goodbye parsing - #273
Merged
Merged
Conversation
Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
Risk: low.
Automated risk review (dry run): Low
This PR would be automatically approved.
Why: Narrow change in Goodbye.java and FDv2ProtocolHandler.java replacing java.time.Duration with millisecond Long values, with matching tests in FDv2PayloadsTest and FDv2ProtocolHandlerTest.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
tanderson-ld
approved these changes
Nov 19, 2026
kinyoklion
pushed a commit
that referenced
this pull request
Nov 19, 2026
🤖 I have created a release *beep* *boop* --- ## [1.13.1](launchdarkly-java-sdk-internal-1.13.0...launchdarkly-java-sdk-internal-1.13.1) (2026-11-19) ### Bug Fixes * Remove java.time.Duration usage from FDv2 goodbye parsing ([#273](#273)) ([171be16](171be16)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release Please** cut for **`launchdarkly-java-sdk-internal` 1.13.1**. The diff only updates the release manifest, `gradle.properties`, and **CHANGELOG**—no application code in this PR. > > The published **1.13.1** patch documents a bug fix ([#273](#273)): **FDv2 goodbye** parsing for `protocolFallbackTTL` no longer uses `java.time.Duration`, storing **milliseconds as `Long`** with a Gson type adapter instead. That keeps the TTL behavior from 1.13.0 while avoiding `Duration` where it isn’t viable (e.g. older Android targets). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit dff5e71. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 of 3 tasks
kinyoklion
added a commit
to launchdarkly/android-client-sdk
that referenced
this pull request
Nov 19, 2026
**Requirements** - [ ] I have added test coverage for new or changed functionality - [x] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests) - [ ] I have validated my changes against all supported platform versions **Related issues** - launchdarkly/java-core#261: the selectorless FDv2 fix in the shared internal module, released in 1.13.0 - launchdarkly/java-core#273: removes `java.time.Duration` from FDv2 goodbye parsing (API 26+ only), released in 1.13.1 - launchdarkly/sdk-test-harness#600: contract tests for FDv2 payloads without a selector **Describe the solution you've provided** Bumps `launchdarklyJavaSdkInternal` from 1.9.0 to 1.13.1 in `launchdarkly-android-client-sdk/build.gradle` and `shared-test-code/build.gradle`. With 1.9.0, a full transfer with an empty `state` produced a non-empty selector, so the SDK sent `basis` on its next request. 1.13.1 also avoids the 1.13.0 `java.time.Duration` call when parsing an FDv2 goodbye with `protocolFallbackTTL`, which is unavailable below API 26 without desugaring. No API changes were needed. **Describe alternatives you've considered** Stopping at 1.13.0, which would introduce the `Duration` use on API 21–25. **Additional context** Local results on Java 17 with an API 25 emulator, run against 1.13.0: - `./gradlew build jar`: 752 unit tests in each of debug and release, 0 failures. - sdk-test-harness#600, `streaming/fdv2/payloads without a selector`: 5/5 pass. 3 of the 5 fail on main. - Full v3 contract suite with the CI-pinned harness (v3.2.0-alpha.10) and `testharness-suppressions-fdv2.txt`: 895 ran, all passed. 1.13.1 was released minutes before this update and may not be on Maven Central yet; rerun CI if dependency resolution fails. Link to Devin session: https://app.devin.ai/sessions/2540f086f1ea4dfba1470051465fb0fd Open in Devin Desktop: https://app.devin.ai/desktop/session/2540f086f1ea4dfba1470051465fb0fd?variant=devin Requested by: @kinyoklion <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Bumps **`launchdarklyJavaSdkInternal`** from **1.9.0** to **1.13.1** in **`launchdarkly-android-client-sdk/build.gradle`** and **`shared-test-code/build.gradle`**. > > This pulls in shared-internal fixes for **FDv2 full transfers with empty `state`**, which previously caused an incorrect non-empty selector and extra **`basis`** requests, and picks **1.13.1** over 1.13.0 so **FDv2 goodbye** parsing avoids **`java.time.Duration`** (API 26+) on **API 21–25** without desugaring. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7e9b48e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Requirements
Related issues
Follow-up to #265. Android consumes this library (android-client-sdk#435);
java.time.Durationis only available natively on API 26+, and Android supports API 21 without core-library desugaring.Describe the solution you've provided
GoodbyeandFDv2ProtocolHandlerinlib/shared/internalnow storeprotocolFallbackTTLas a nullableLongof milliseconds instead of aDuration. The wire format (seconds) is unchanged.Internal API changes:
Goodbye.getProtocolFallbackTTL()(returnedDuration) is replaced bygetProtocolFallbackTTLMillis()(returnsLong).Longof milliseconds; the one-argument constructors are unchanged.Neither the Java server SDK nor the Android SDK calls the old getter. The compiled production classes in the module have no
java.timereferences.Describe alternatives you've considered
Keeping the
Durationgetter alongside a millis accessor. That still leavesDurationin the parse path, which is what runs on Android.Additional context
Ran
FDv2PayloadsTestandFDv2ProtocolHandlerTestplus the rest of the module's JUnit tests directly: 324 passing. Local Gradle/Checkstyle was blocked by Maven Central rate limiting, so CI is the check for those.Link to Devin session: https://app.devin.ai/sessions/2540f086f1ea4dfba1470051465fb0fd
Open in Devin Desktop: https://app.devin.ai/desktop/session/2540f086f1ea4dfba1470051465fb0fd?variant=devin
Requested by: @kinyoklion
Note
Overview
FDv2 goodbye handling no longer uses
java.time.DurationforprotocolFallbackTTL.GoodbyeandFDv2ProtocolHandler.FDv2ActionGoodbyenow hold a nullableLongin milliseconds, with wire JSON still expressed in seconds via the existingFallbackTTLAdapter(malformed values still map to 0).The public internal API rename is
getProtocolFallbackTTL()→getProtocolFallbackTTLMillis(), and constructors that took aDurationtake millis instead. Tests inFDv2PayloadsTestandFDv2ProtocolHandlerTestexpect millis values and add coverage that Gson serializes TTL back to seconds (e.g. 1250 ms →1.25).Reviewed by Cursor Bugbot for commit 1f5fe34. Bugbot is set up for automated code reviews on this repo. Configure here.