Repository navigation
Follow the new data file's properties, tier and publish date on refresh - #194
Merged
Merged
Conversation
A refresh swapped in the new data set but kept everything the engine had taken from the old one. The Device Detection engine went on listing and reading only the old file's properties, under the old tier, so a Lite engine updated to an Enterprise file reported 22 properties, the tier Lite, and no value for the properties the Lite file lacks. The IP Intelligence engine went on reporting the old tier and publish date. Each engine now keeps the properties a detection reads with the data set they belong to, and replaces its property metadata and tier when a data file with others is loaded. The pipeline traits lend those by reference for as long as the engine lives, so each one replaced is kept rather than freed. A refresh records the IP Intelligence file's publish date, and refreshes run one at a time.
This was referenced Oct 27, 2026
Merged
Merged
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.
Closes #163.
Problem
A refresh swapped in the new data set and kept everything else the engine had taken from the old file.
device-detection-onpremise/src/engine.rslines 159 to 173,reload_from_path, lines 361 to 379). A Lite engine refreshed onto the Enterprise test file reported the tierLiteand 22 properties and read no value forHardwareModel, where an engine built on that file reportsEnterprise, 289 properties andiPhone.ip-intelligence-onpremise/src/engine.rslines 218 to 247).Update on start-up and automatic updates make this common, because a deployment that starts from the free Lite file with a licence key receives the file the key entitles it to. .NET reads the metadata again after every refresh (DeviceDetectionHashEngine.cs lines 489 to 509). #163 has the details.
Change
How it was verified
New tests, each needing a second data file beside the one CI provides, and skipping with a note without it:
a_refresh_reads_and_reports_the_properties_of_the_new_data_file(device-detection-onpremise/tests/refresh.rs) refreshes an engine built on the Lite file afterEnterprise-HashV41.hashreplaces it, and checks its tier, its properties, its aspect properties and theHardwareModelit reads for an iPhone match an engine built on the Enterprise file.a_refresh_reports_the_tier_and_publish_date_of_the_new_data_file(ip-intelligence-onpremise/tests/refresh.rs) refreshes an engine built on the ASN file after51Degrees-LiteV41.ipireplaces it, and checks its tier, its aspect properties and its publish date match an engine built on the Lite file.Before the change, on a branch holding only the new tests, both fail. The Device Detection engine refreshed onto the Enterprise file still reports the tier
Litewhere an engine built on that file reportsEnterprise, and the IP Intelligence engine refreshed onto the Lite file still reportsIPIV4Asnwhere an engine built on it reportsIPIV4Lite. After it, both pass.Refresh with work in flight, measured with this change and #195 applied, with a probe that is part of neither: four threads ran 25,866 Device Detection detections while the data file alternated between the Lite and the Enterprise files and 14 refreshes ran two at a time. No detection or refresh failed, a detection made before the first refresh still read its values after the last, and the engine ended reporting
Enterprisewith 289 properties. The same with IP Intelligence gave 405,765 lookups over 532 refreshes underInMemory, and 43,941 lookups over 124 refreshes underDefault, with no failure.Locally on Windows, with all seven fixes of this sweep merged together (#175, #178, #182, #184, #194, #195 and #196),
cargo test --no-fail-fast -p fiftyone-pipeline-engines -p fiftyone-device-detection-onpremise -p fiftyone-ip-intelligence-onpremise -p fiftyone-device-detection -p fiftyone-ip-intelligence -- --nocapture, with51DEGREES_DD_PATHnaming the Lite Hash file,Enterprise-HashV41.hashbeside it, and51DEGREES_IPI_PATHnaming the ASN file,51Degrees-LiteV41.ipibeside it, gives 130 passed, 0 failed and 2 ignored across 24 test binaries. With the fixes merged,cargo doc --workspace --no-depswithRUSTDOCFLAGS="-D warnings"passes, andrustfmt --checkpasses on every file the seven fixes change.cargo clippy --workspace --all-targets -- -D warningson the merged fixes has not run yet. ThePull Requestworkflow, which builds and tests each pull request on every platform, is waiting for approval to run.Behaviour that changes
After a refresh to a data file with other properties or another tier, the engine lists, reports and reads that file's properties and tier, as an engine built on it does. A tier set on the builder is kept. Each distinct property list an engine has loaded stays in memory until the engine is dropped, one list for each change of the data file's properties or tier.
What remains