Skip to content

fix(server): compare numeric string flag properties numerically - #862

Merged
dustinbyrne merged 1 commit into
mainfrom
fix/numeric-string-flag-comparisons
Oct 20, 2026
Merged

dustinbyrne merged 1 commit into
mainfrom
fix/numeric-string-flag-comparisons

Conversation

@dustinbyrne

@dustinbyrne dustinbyrne commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Local gt, gte, lt, and lte comparisons could order numeric strings lexicographically, changing flag membership relative to remote evaluation. For example, "10" gt 2 should match and "100" lt 30 should not.

Use complete ASCII decimal parsing and finite binary64 comparison, following the shared SDK specification. Existing numeric JSON filter operands remain supported alongside the spec's string operands. Invalid actual values are definitive no-matches; invalid conditions remain inconclusive and retain existing remote-fallback eligibility. Standard Number values, including BigDecimal and BigInteger, retain finite binary64 conversion. This changes the server module only.

Related to PostHog/posthog-python#1077. Part of the coordinated Python, Ruby/Rails, PHP and Java server correction.

Related SDK PRs:

💚 How did you test it?

  • All 591 server tests.
  • Root Spotless checks.
  • Server-only patch changeset validation.

Regression coverage checks all four operators, numeric/string operands, strict parsing, non-finite values, rounding, null/missing properties and local-only versus remote fallback. The same regressions were checked across the affected SDKs. Scoped patch release metadata is included because evaluated membership can change.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I included scoped patch release metadata for the behavior correction.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with Pi and isolated SDK workers. Ran simplify and the pre-PR review loop with fresh read-only reviewers; shared findings were checked against all four SDKs. Human review is still required.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@dustinbyrne
dustinbyrne merged commit 25e65fe into main Oct 20, 2026
17 checks passed
@dustinbyrne
dustinbyrne deleted the fix/numeric-string-flag-comparisons branch October 20, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants