FIX: Bump device-detection-cxx and align tests to unified result shape#559
Merged
Merged
Conversation
Jamesr51d
approved these changes
Jul 23, 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.
Relates to #TASK
Picks up the
device-detection-cxxchange that unified the detection resultshape (51Degrees/device-detection-cxx#362, merged in
51Degrees/device-detection-cxx#385) and updates the two test assertions that
encoded the removed fast path.
The submodule bump and the test updates have to land together: the new
assertions do not hold against the previous native library, and the old ones do
not hold against the new one.
Why the nightly failed
The nightly on #558 reported 3 failures out of 33 in
51Degrees :: Device Detection :: Hash :: On Premise(run):
Both assertions tied the result shape to evidence cardinality, which is exactly
the coupling #362 removed:
DataValidatorHashcounted the accepted evidence keys and asserted onematched User-Agent per key.
ValueTests.matchedUserAgentsasserted exactly one.Detection now produces one result per component the engine populates, so a
single User-Agent yields 4 rather than 1. These are the intended consequence of
the native change, not new defects.
Changes
device-detection-cxxtoc7b2822(includes Update submodules #362 / Update properties #385).DataValidatorHash— replace the per-evidence-key equality with a bound (nomore matched User-Agents than components the engine populates) plus "valid
evidence yields at least one result".
ValueTests.matchedUserAgents(shared test helpers) — same bound. Theper-entry check that every matched substring really occurs at the expected
offset in the original User-Agent is untouched; that is the substantive
assertion.
The counts are deliberately asserted as a bound rather than a fixed number: the
exact value is "components that have available properties", which depends on the
data file. Pinning a literal would make the tests brittle across data file
revisions. This also brings the on-premise helper into line with the cloud
ValueTests.matchedUserAgents, which already asserts a range rather than anexact count.
Only the on-premise path is affected —
ValueCloudTestsimports the cloudmodule's own
ValueTests, which is unchanged.Verification
Built the native engine against the new submodule and ran the tests on Windows
x64 (JDK 17):
device-detection.hash.engine.on-premise: 33 tests, 0 failures (was 3failures)
device-detection.shared: 3 tests, 0 failuresBehaviour change to be aware of
#362 is an observable change for on-premise consumers, and this PR is where it
reaches Java:
getUserAgents()(and match metrics derived from theresult list) is now determined by the data file's components, not by how many
evidence pairs were supplied. Redundant evidence no longer changes it.
allowUnmatchedenabled, components with no matched profile are filledwith each component's default profile, matching evidence-based processing.
Please call these out in the release notes. The same change is landing in
device-detection-dotnet, and the other on-premise language bindings will need
the equivalent test updates as their submodule PRs land.
Supersedes
Replaces the automated submodule PR #558, which cannot go green on its own
because it carries the bump without the matching test updates. Close #558 when
this merges.