-
Notifications
You must be signed in to change notification settings - Fork 31
fix: evaluation detail type should be optional #1064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
|
@launchdarkly/browser size report |
| * An optional object describing the main factor that influenced the flag evaluation value. | ||
| */ | ||
| reason: LDEvaluationReason | null; | ||
| reason?: LDEvaluationReason | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to make null not a possibility. How problematic do we think that would be?
Can RN just ?? null it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually better... I thought it was nullable in the previous sdk (which was why I made it this way)... but apparently not https://github.com/launchdarkly/js-sdk-common/blob/cb9e954d9bf6715021e169c80a6ab9862cafd226/typings.d.ts#L1030 ... I poke around more, but I would also prefer not having null as a possible value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
2c4e445 to
3b6e776
Compare
3b6e776 to
99fc7df
Compare
This PR will:
Note
reasonoptional inLDEvaluationDetailandLDEvaluationDetailTyped(src/api/LDEvaluationDetail.ts). UpdatecreateSuccessEvaluationDetailto omitreasonwhen undefined (evaluation/evaluationDetail.ts).LDClientImplnow emits flag detail changes withoutreasonfor non-reason cases (e.g., deleted/unknown flags), and tests updated to match (removedreason: nullexpectations).hooks/variation/LDEvaluationDetail.tsdefining RN-specific types withreason | null, and re-export them fromindex.tsto override common types.useTypedVariationDetailnormalizes returned details to ensurereasonisnullwhen absent across typed variation methods.reasonand updated detail shapes.Written by Cursor Bugbot for commit 99fc7df. This will update automatically on new commits. Configure here.