Skip to content

fix: Clear empty FDv2 selectors in shared protocol handling - #261

Draft
kinyoklion wants to merge 2 commits into
mainfrom
devin/1794591805-fdv2-selectorless
Draft

kinyoklion wants to merge 2 commits into
mainfrom
devin/1794591805-fdv2-selectorless

Conversation

@kinyoklion

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

launchdarkly/ld-relay#979 sends FDv2 full transfers with no selector (payload-transferred {"state":"","version":0}). The shared FDv2ProtocolHandler built Selector.make(0, "") from it, and that selector is not empty. As a result, the server SDK and Android sent an empty basis= on later polls and stream reconnects. The contract test for this is launchdarkly/sdk-test-harness#600.

Describe the solution you've provided

  • FDv2ProtocolHandler (shared internal): an empty transferred state now becomes Selector.EMPTY. The existing store assignment then clears the held selector. The server polling and streaming requests already check isEmpty(), so they leave out basis.
  • Tests: the shared handler moving from a selector-bearing transfer to a selectorless one, with both populated and empty payloads, plus a non-empty state at version 0. Server tests confirm that polling and streaming leave out basis once the selector is empty.
  • Selector-bearing behavior and initialization are unchanged.

Android uses this shared handler. It needs an internal dependency bump after release (it currently pins 1.9.0). The Java server SDK pins 1.12.2.

Describe alternatives you've considered

Guarding each request builder against an empty state. Normalizing once in the shared handler fixes server and Android in one place.

Additional context

I couldn't verify this locally. Maven Central returned HTTP 429 during Gradle dependency resolution, so tests, Checkstyle, and the selectorless contract group did not run. CI is the first real check.

Link to Devin session: https://app.devin.ai/sessions/f3b22e19bdde48f1b39f77808077390b
Open in Devin Desktop: https://app.devin.ai/desktop/session/f3b22e19bdde48f1b39f77808077390b?variant=devin
Requested by: @kinyoklion

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant