Skip to content

Run the IP Intelligence mixed API example on the free data files, and name what needs the Enterprise files - #111

Merged
jwrosewell merged 2 commits into
rcfrom
examples/mixed-api-free-files
Nov 14, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
examples/mixed-api-free-files

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The IP Intelligence mixed API example, which runs a local copy of the cloud service's API on both on-premise engines, does not run from a fresh clone as the other examples do (gap DX-node-29, left under "Not changed" in #32 and "What remains" in #95). At 7539a0be:

  • It looks for TAC-HashV41.hash, 51Degrees-EnterpriseV4.1.hash and 51Degrees-EnterpriseIpiV41.ipi before the Lite files (gettingStarted.js lines 97 to 107 and the loops at lines 281 and 292). The data repository links none of those three, so ExampleUtils.findFile searches the disk for each for up to 10 seconds (exampleUtils.js lines 42 and 250 to 258) before it takes a Lite file.
  • It says nothing about what only the Enterprise data files hold, and gives no link to ask for them.
  • Neither no-settings test runs it, and its own test skips where it finds no paid Device Detection file (gettingStarted.test.js line 57).

What the specification says

device-detection-specification/required-examples.md lines 20 to 23 at c8128ca4:

Those tests MUST include a run of each example with no arguments or settings, as someone would run it from a fresh clone, so that the run uses the free data files.

The same page, lines 101 to 113, asks each example to show what only the Enterprise Data File can do, saying of each such Property the data file in use cannot give that it needs the Enterprise Data File, and once giving a link to the contact page to ask for a copy. The IP Intelligence page, lines 80 to 91, applies the same rules and names Latitude, Longitude and Areas among the Properties only the Enterprise data file holds.

What changed

  1. With no arguments the example uses the free 51Degrees-LiteV4.1.hash and 51Degrees-LiteV41.ipi, which it downloads when they are missing. A paid file can still be given as the first and second command line arguments, or in _51DEGREES_DD_PATH and _51DEGREES_IPI_PATH, which findDeviceDataFile and findDataFile read first.
  2. Once the API is listening, it names each of HardwareVendor, HardwareName, DeviceType, Country, Latitude, Longitude and Areas that the data file in use does not have, as needing the Enterprise data file, and then gives the tagged contact link once. The Find out more section #103 added still follows.
  3. The comments say what the example now does by default, including that a paid IP Intelligence file given to it can be about 6 GB, which is why it keeps the low memory profile.

This follows 51degrees-dotnet#175, which made the same change to .NET's mixed API example.

Tests

A new test in examplesWithoutSettings.test.js starts the API in its own process on the free Lite files, with every data file and licence key setting removed, asks it for /accessibleproperties, and checks that the answer holds both engines, that the output names HardwareVendor, Country and Latitude as needing the Enterprise data file, gives the contact link, and ends with the Find out more section.

  • Red, run 43564759306, the test on the example as End every example with Find out more #103 left it, with the native modules built on one Ubuntu runner. It failed at "HardwareVendor: needs the Enterprise data file", which the example did not write.
  • Green, in the full build below. A one-runner green, run 43564766035, stopped at its 60 minute limit while downloading the 478 MB free IP Intelligence Lite file, which the full build takes from CI's cache of data files instead.

The two commits were first made on #103's branch and then put on rc once #103 had merged, with no other change.

Full build

Run 43576065332 on tmp/pr-matrix-111, started by tools/pr-matrix.py without macOS. All 7 Setting 'PullRequestSha' lines give this head, d6edecb, 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,481 unit tests with 2 skipped and 151 integration tests with 4 skipped, and in each the IP Intelligence examplesWithoutSettings.test.js, which holds the new test, passed.

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 API's port, 5225, is fixed, so the test uses it too.

@jwrosewell
jwrosewell marked this pull request as ready for review November 14, 2026 09:25
@jwrosewell
jwrosewell merged commit a9a3bd2 into rc Nov 14, 2026
2 checks passed
@jwrosewell
jwrosewell deleted the examples/mixed-api-free-files branch November 14, 2026 09:25
@jwrosewell jwrosewell mentioned this pull request Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant