Repository navigation
Add every component's drift for Drift, as the specification says - #614
Draft
jwrosewell wants to merge 1 commit into
Draft
jwrosewell wants to merge 1 commit into
jwrosewell wants to merge 1 commit into
Conversation
This branch has not been deployed
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 #613.
The problem
DeviceDataHashDefault.getDriftInternalreturned the smallest drift among the native results, one per component, starting fromInteger.MAX_VALUE. The specification's match metrics table describesDriftas the total difference in character positions, and 51Degrees/specifications#39 says it in full: the drift of every component's result added together. The C++ results add them (ResultsHash.cpp#L183-L192), as do Go and the Node, PHP and Python wrappers, so the same evidence gave a smallerDrifthere whenever more than one component drifted.What changes
getDriftInternaladds the results' drift, asgetDifferenceInternal,getMatchedNodesInternalandgetIterationsInternalin the same class already do. A test gives two mocked native results drifts of 3 and 5 and reads 8 fromgetDrift.How it was verified
mvn test-compilewith-DskipNativeBuild=trueondevice-detection.hash.engine.on-premiseand the modules it depends on compiles the change and the new test. The test itself needs the native library and the data file, which the pull request build provides.