Repository navigation
EU Data Act: prefer current mileage.value key for odometer - #35294
Merged
Merged
Conversation
refs #35100 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="vehicle/vw/eudataact/provider.go" line_range="136" />
<code_context>
}
- if p := lookup(data, FieldOdometer, FieldOdometerValue); p != nil {
+ if p := lookup(data, KeyMileageValue, FieldOdometer, FieldOdometerValue); p != nil {
return strconv.ParseFloat(p.Value, 64)
}
</code_context>
<issue_to_address>
**Stale mileage overrides current reading**
When both the current-key point and a fallback mileage point are present, and the fallback has a higher `Seq`, `lookup` compares `Seq` across matches before honoring the exact-key match, so the fallback overrides the current-key point and `Odometer` returns stale mileage.
Prioritize the exact-key point over fallback name matches, regardless of `Seq`.
</issue_to_address>
### Comment 2
<location path="vehicle/vw/eudataact/provider.go" line_range="136" />
<code_context>
}
- if p := lookup(data, FieldOdometer, FieldOdometerValue); p != nil {
+ if p := lookup(data, KeyMileageValue, FieldOdometer, FieldOdometerValue); p != nil {
return strconv.ParseFloat(p.Value, 64)
}
</code_context>
<issue_to_address>
**Invalid mileage prevents fallback**
When the preferred-key point has a nonnumeric value while a fallback mileage point has a valid value, `Odometer` parses only the selected point and returns its parse error, so a malformed value for the preferred key masks a valid fallback mileage and the caller gets no odometer reading.
Try the remaining matching mileage points if parsing the preferred point fails, and return an error only if none parse successfully.
</issue_to_address>
andig
commented
Oct 25, 2026
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
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.
fixes #35100
VW delivers two
mileage.valueentries in random order. Name lookup picks whichever comes first, so the odometer jumps between the current and a stale value. Key69d437d3tracks the app according to the reporter and is now looked up first.🤖 Generated with Claude Code