Repository navigation
Read the accepted Evidence keys again when an on-premise engine's data is refreshed - #130
Merged
Merged
Conversation
…ain when the data is refreshed
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.
Problem
Both on-premise engines read the Evidence keys they accept from the native engine once, when the native engine is created, and never again. A refresh of the data file calls
refreshData()and keeps the filter made from the data file the engine started with.initEngine(device-detection/fiftyone.devicedetection.onpremise/deviceDetectionOnPremise.jslines 474 to 487 at 6d5d4fef), and the refresh only reloads the data (lines 549 to 552).ip-intelligence/fiftyone.ipintelligence.onpremise/ipIntelligenceOnPremise.jslines 331 to 344 and lines 404 to 407).So after an update to a data file that accepts other keys, the Pipeline keeps the Evidence the old file wanted, and drops Evidence the new file can use.
What the specification says
From
device-detection-specification/pipeline-elements/device-detection-on-premise.mdlines 78 to 86 at 706de1f0:ip-intelligence-specification/pipeline-elements/ip-intelligence-on-premise.mdlines 75 to 84 at 706de1f0 says the same for the IP Intelligence Engine, with the keys kept in the order the native code tries them.What changed
In both engines a local
readEvidenceKeyFilterreads the keys from the native engine, in the order it gives them and in lower case as before, and makes the filter.initEngineuses it, as before, and the refresh now uses it again straight afterrefreshData(). An engine that starts with no data file and builds its native engine on the first refresh goes throughinitEngineas before.Tests
tests/refreshEvidenceKeys.test.jsin each on-premise package builds the engine on a copy of the free data file (the Lite file for Device Detection, the ASN file for IP Intelligence), checks that its filter accepts every key the native engine gives, then wraps the native engine so thatgetKeysgives one more key and refreshes the data file through the data file the engine registers. The filter must then accept the new key, in any letter case, and still accept every earlier key.Red, run 43649919865 on 1c6a1ab, the test commit on
rc's code, with only a throwaway workflow added that builds the native modules and fetches the free data files as CI does. On Ubuntu both new tests fail at the same check, as the filter does not accept the new key after the refresh (Expected true, Received undefined).Green, run 43649927428 on 5560b26, the fix, with only the same throwaway workflow added. Both tests pass, and lint passes on both on-premise packages.
Full build
Run 43651566189 on
tmp/pr-matrix-130, started bytools/pr-matrix.pywithout macOS. All 7Setting 'PullRequestSha'lines give this head, 5560b26, and Configure printed "Left out 2 macOS entries". Each of the six Build and Test jobs, Ubuntu, Ubuntu ARM and Windows on Node.js 22 and 24, passed 1,514 unit tests with 2 skipped and 96 integration tests with 4 skipped.macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
What remains
The Property metadata is not read again on a refresh either. An engine built with no Property names keeps the Property list it started with, as the C library does and as #108's reload test shows, so that is left as it is.