Skip to content

fix: add missing SetReasonOnly to objectResponseV2#1925

Open
toddbaert wants to merge 1 commit intomainfrom
fix/object-fallback-set-reason-only
Open

fix: add missing SetReasonOnly to objectResponseV2#1925
toddbaert wants to merge 1 commit intomainfrom
fix/object-fallback-set-reason-only

Conversation

@toddbaert
Copy link
Copy Markdown
Member

@toddbaert toddbaert commented Apr 2, 2026

objectResponseV2 was missing the SetReasonOnly method, unlike all other V2 response types.

I added an assertion to prevent regressions.

thanks @asppsa for the detailed report!

Fixes: #1913

objectResponseV2 was missing the SetReasonOnly method, unlike all other
V2 response types. This caused the fallback path (null targeting + no
defaultVariant) to silently return empty responses for object flags.

Also adds compile-time interface satisfaction checks for all V2 response
types to prevent this class of bug in the future.

Closes #1913

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
@toddbaert toddbaert requested review from a team as code owners April 2, 2026 18:33
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for polite-licorice-3db33c canceled.

Name Link
🔨 Latest commit 6a0aeaf
🔍 Latest deploy log https://app.netlify.com/projects/polite-licorice-3db33c/deploys/69ceb669c3aa6b0008fb25d7

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 2, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates several Go dependencies in the go.sum file and enhances the flag evaluation service. Specifically, it adds compile-time interface satisfaction checks for the responseV2 interface and implements the SetReasonOnly method for the objectResponseV2 type, allowing for the assignment of reasons and metadata to responses without a result value. No review comments were provided, so I have no feedback to offer.

@suthar26
Copy link
Copy Markdown

suthar26 commented Apr 2, 2026

@toddbaert would be nice to add a testcase for this to ensure something like this is not missed in another version bump

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

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] null values in targeting rules for object-valued flags when there is no defaultValue should evaluate to the code default

2 participants