Repository navigation
feat: Add flag change listener support to the contract test service - #240
Draft
kinyoklion wants to merge 1 commit into
Draft
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
The service now declares the flag-change-listeners and flag-value-change-listeners capabilities and handles the registerFlagChangeListener, registerFlagValueChangeListener, and unregisterListener commands. Each registered listener posts a notification to the callback URI the harness supplies when the SDK fires it, with the old and new values for a value change listener. Listeners are keyed by the harness's listener ID, a re-registered ID replaces the earlier listener, and closing the client removes them all.
Member
Author
|
bugbot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c46c68d. Configure here.
This branch has not been deployed
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
The Java contract test service did not declare the
flag-change-listenersandflag-value-change-listenerscapabilities, so the test harness skipped its flag change listener suite for Java. The suite now also covers dependent-flag notifications (sdk-test-harness #514) and override change notifications (#515), and Java should be checked by all of it.The service now declares both capabilities and handles the three listener commands.
ListenerRegistrykeeps the listeners the harness has registered with one SDK client, keyed by the harness's listener ID. A general flag change listener is registered withFlagTracker.addFlagChangeListenerand posts the flag key of every change event to its callback URI. A flag value change listener usesFlagTracker.addFlagValueChangeListenerfor the given flag and context and posts the old and new values when the SDK reports a value change.unregisterListenerremoves the listener and returns 400 for an unknown ID; closing the client removes them all; re-registering an ID replaces the earlier listener. Notifications are posted through the existingHookCallbackService, and a failed post is logged rather than thrown, since the SDK calls listeners from its worker thread.The Java API has no application default value for a value change listener, so the
defaultValuethe harness sends is accepted and not used; the harness tests only compare the values of flags that exist.Verification
Run locally: the released harness listener suite passes against this service, and so does the dependent-flag suite from sdk-test-harness #514 (prerequisite chains, segment and nested segment references, a segment behind a prerequisite, deletions, and full data sets). With this commit cherry-picked onto the flag overrides stack (#225), the override change notification suite from sdk-test-harness #515 passes as well. CI will run the released suite once the capabilities are declared.