feat(java): add multi-flag resolve with deferred apply#273
Closed
feat(java): add multi-flag resolve with deferred apply#273
Conversation
Add resolve() and applyFlag() methods to OpenFeatureLocalResolveProvider for resolving multiple flags at once with apply=false, returning ResolveFlagsResponse with resolveToken for deferred application. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
nicklasl
commented
Feb 11, 2026
| ResolveFlagsRequest.newBuilder() | ||
| .addAllFlags(requestFlagNames) | ||
| .setApply(apply) | ||
| .setClientSecret(clientSecret) |
Member
Author
There was a problem hiding this comment.
not sure we should set this but it follows the same design as the JS provider equivalens.
Member
Author
There was a problem hiding this comment.
Some more reasoning about this:
This provider has been initialized with a clientSecret. That's client is the only state it will be able to fetch currently. This mean that we cannot risk taking a client secret from the request.
nicklasl
commented
Feb 11, 2026
| .toCompletableFuture() | ||
| .get(); | ||
| } catch (ExecutionException | InterruptedException e) { | ||
| throw new RuntimeException("Failed to resolve flags", e); |
Member
Author
There was a problem hiding this comment.
Do we really want to throw here? Probably not?
nicklasl
commented
Feb 11, 2026
| instance.applyFlags(request); | ||
| } catch (IsClosedException e) { | ||
| if (closedRetries >= MAX_CLOSED_RETRIES) { | ||
| throw new RuntimeException( |
Member
Author
There was a problem hiding this comment.
same here... really throw?
nicklasl
commented
Feb 11, 2026
...src/test/java/com/spotify/confidence/sdk/OpenFeatureLocalResolveProviderIntegrationTest.java
Show resolved
Hide resolved
nicklasl
commented
Feb 11, 2026
...src/test/java/com/spotify/confidence/sdk/OpenFeatureLocalResolveProviderIntegrationTest.java
Show resolved
Hide resolved
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.
Summary
resolve()method toOpenFeatureLocalResolveProviderfor resolving multiple flags at once withapply=falseapplyFlag()method for deferred flag application using the resolve tokenapplyFlagsWASM export toWasmResolveApiand propagate through resolver chainUsage
Test plan
🤖 Generated with Claude Code