Skip to content

Warn on the web pages from the data file's published date, and test the Device Id row - #102

Merged
jwrosewell merged 2 commits into
rcfrom
examples/web-page-rows
Nov 14, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
examples/web-page-rows

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Two gaps from the examples audit, both recorded under "Not changed" in #32.

  1. The data file age warning never shows on the three on-premise web pages (DX-node-17). Each page is given the current time as the data file's published time and compares a number of days with milliseconds. Device Detection gettingStarted.js lines 269 and 270 at 758fea81 pass dataFilePublishedTime: new Date().getTime() and dataFileAgeWarning: DATA_FILE_AGE_WARNING (30), and index.pug line 10 shows the warning when new Date().getTime() > dataFilePublishedTime + dataFileAgeWarning. The IP Intelligence page (gettingStarted.js lines 229 and 230) and the mixed page (lines 177 and 178) do the same. The console examples already work this out from the engine's published date (exampleUtils.js line 285).
  2. Nothing checks the Device Id row on the Device Detection page (DX-node-18). Run every example on the free data files, and show what needs the Enterprise data file #32 recorded the row showing "Unknown (the property 'deviceid' is not in the results...)". The page reads deviceid in lower case (gettingStarted.js line 289), while the engine's own key is deviceID. rc now finds the key without regard to case, through getInternalIgnoringCase in swigData.js lines 177 to 195, but no test reads the row.

What the specification says

pipeline-specification/features/access-to-results.md lines 10 and 11 at c8128ca4:

  • Lower-case SHOULD be used.
  • String comparisons MUST be case insensitive.

So deviceid must find DeviceId, which it does on rc. The specification does not describe the examples' data file age warning, so the console examples' rule, a warning once the file is more than 30 days old, is the one the pages now follow.

What changed

  1. ExampleUtils.isDataFileOld(pipeline) is new in both on-premise exampleUtils.js files. It is true when the published date the engine gives is more than DATA_FILE_AGE_WARNING days ago, for the Device Detection engine in that package, and for the IP Intelligence or the Device Detection engine in the IP Intelligence one, so the mixed page warns when either of its two files is old.
  2. The three pages pass dataFileOld from it, and their templates show the warning when it is true. The warning's text, which names the number of days, is unchanged.
  3. Each page's setPipeline returns the Pipeline it built, so a test can ask about the same data file the page used.
  4. Nothing changes for the Device Id row, which rc already reads right.

Tests

Written first, in commit 51c0b9a2. A new dataFileAge.test.js in each of the three web example folders checks isDataFileOld with an engine whose file was published two days either side of the warning age, and that the page shows the warning exactly when isDataFileOld says the page's own Pipeline is old, so it holds whatever the age of the file CI fetches. The Device Detection one also checks that the Device Id row shows an id of four numbers.

  • Red, the full build of the test commit (run 43555197471). All 7 Setting 'PullRequestSha' lines, Configure's and the six jobs', are 51c0b9a, and each of the six jobs failed exactly the 6 age tests, two for each page, with 133 other integration tests and 1,367 unit tests passing. The Device Id row test passed, as rc reads the row right.

  • Green, in the full build of the fix below, where each of the six jobs passed the 6 age tests and the Device Id row test.

Full build

Run 43560480172 on tmp/pr-matrix-102, started by tools/pr-matrix.py without macOS. All 7 Setting 'PullRequestSha' lines give this head, 87ca1b3, 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,373 unit tests with 2 skipped and 140 integration tests with 4 skipped, the new page tests among them.

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

Nothing in this repository for these two gaps.

@jwrosewell
jwrosewell marked this pull request as ready for review November 14, 2026 07:51
@jwrosewell
jwrosewell merged commit 516145b into rc Nov 14, 2026
2 checks passed
@jwrosewell
jwrosewell deleted the examples/web-page-rows branch November 14, 2026 07:51
@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