You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(Engine): Evaluation fails when a numeric trait meets a condition value of another type - #206
…value of another type
Integer traits now share the 64-bit integer comparison path, and float
traits handle unparseable condition values, so such conditions no longer
match instead of throwing FormatException. This matches
flagsmith-flag-engine, which the Flagsmith API uses for remote evaluation.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Integer conditions now use LongOperations. Double conditions return false when parsing the condition value raises FormatException. Tests cover numeric comparisons and equality when the trait value or condition value is non-numeric.
Out-of-range condition values can still abort local evaluation, including double conditions on older supported runtimes. Handle both conversion failures before merging.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Return a non-match when integer conversion overflows.
If an Int32 or Int64 trait meets a condition value such as "9223372036854775808", InvariantConvert.ToInt64 throws OverflowException. This catch handles only FormatException, so GetEvaluationResult aborts instead of returning a non-match. Handle OverflowException here as well. (learn.microsoft.com)
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: d13c6f2a-57eb-42e4-8de0-938e112071d6
Commits
Reviewing files that changed from the base of the PR and between e2c5320 and 099c12d.
Files selected for processing: 3
Flagsmith.Engine/Engine.cs
Flagsmith.Engine/Utils/InvariantConvert.cs
Flagsmith.EngineTest/EngineTest.cs
Files with no reviewable changes: 1
Flagsmith.Engine/Utils/InvariantConvert.cs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
GetEvaluationResult can route a System.Double trait to DoubleOperations. On .NET Framework and pre-.NET Core 3 runtimes, Convert.ToDouble("1e309", CultureInfo.InvariantCulture) throws OverflowException. The current handler catches only FormatException, so evaluation can fail on older runtimes supported by the netstandard2.0 library target.
IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
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
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.
Currently slop.
🤖 Generated with Claude Code