-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: TypeMismatch error is handled #170
Merged
Merged
Conversation
This file contains 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
fabriziodemaria
commented
Nov 5, 2024
@@ -30,7 +30,7 @@ class ConfidenceIntegrationTests: XCTestCase { | |||
.withContext(initialContext: ctx) | |||
.build() | |||
try await confidence.fetchAndActivate() | |||
let intResult = confidence.getEvaluation(key: "\(resolveFlag).my-integer", defaultValue: "1") |
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.
This started failing after our fix, good outcome 👍
fabriziodemaria
force-pushed
the
fix-typemismatch
branch
from
November 5, 2024 17:10
8ad1db4
to
bcdc39b
Compare
fabriziodemaria
requested review from
mfranberg,
vahidlazio,
nicklasl and
nickybondarenko
as code owners
November 5, 2024 17:10
fabriziodemaria
force-pushed
the
fix-typemismatch
branch
from
November 6, 2024 07:02
bcdc39b
to
2499166
Compare
fabriziodemaria
commented
Nov 6, 2024
Comment on lines
+88
to
+95
if parsedValue == .init(null: ()) { | ||
return Evaluation( | ||
value: defaultValue, | ||
variant: resolvedFlag.variant, | ||
reason: resolveReason, | ||
errorCode: nil, | ||
errorMessage: nil | ||
) |
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.
The expected behaviour when getting null from backend is to use the client-side default value
nicklasl
reviewed
Nov 6, 2024
nicklasl
approved these changes
Nov 6, 2024
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.
This is an important fix to signal users that the returned value is the default value due to a type mismatch, rather than looking like the variant's value returned by the backend.
This happens when the user tries to get a value with a type that is not the the same type defined in the backend schema for that value.