Skip to content

Conversation

@oschwald
Copy link
Member

@oschwald oschwald commented Dec 6, 2025

The ipRisk field now uses useDefault=true, so it defaults to 0.0 when
not present in the database record. A value of 0.0 indicates the risk
score was not set. Added tests for IP Risk database reading.

Also updates maxmind-db submodule to include test data for records
without ip_risk field.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

The ipRisk field now uses useDefault=true, so it defaults to 0.0 when
not present in the database record. A value of 0.0 indicates the risk
score was not set. Added tests for IP Risk database reading.

Also updates maxmind-db submodule to include test data for records
without ip_risk field.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@oschwald oschwald requested a review from Copilot December 6, 2025 17:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where IpRiskResponse decoding fails when the ip_risk field is missing from database records by defaulting to 0.0 instead of throwing an error.

  • Added useDefault=true to the @MaxMindDbParameter annotation for the ipRisk field
  • Added comprehensive test coverage for IP Risk database reading, including a test case for records without the ip_risk field
  • Updated documentation to clarify that 0.0 indicates an unset risk score and added a TODO for future API improvement

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/test/resources/maxmind-db Updated submodule to include test data for records without ip_risk field
src/test/java/com/maxmind/geoip2/DatabaseReaderTest.java Added tests for IP Risk database reading, including handling of missing ip_risk field
src/main/java/com/maxmind/geoip2/model/IpRiskResponse.java Added useDefault=true to ipRisk parameter and updated documentation
CHANGELOG.md Documented the bug fix for version 5.0.2

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@horgh horgh merged commit bf594e9 into main Dec 7, 2025
29 of 30 checks passed
@horgh horgh deleted the greg/eng-3610 branch December 7, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants