Repository navigation
Answer a missing Property in the examples with the contact link in plain text - #193
Merged
Merged
Conversation
This was referenced Nov 16, 2026
Draft
ben51degrees
marked this pull request as ready for review
November 19, 2026 17:18
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
The example helpers that read a Property through
PropertyHelper.tryGetanswered a Property the data file or resource key in use cannot give with an HTML anchor to the pricing page,See data file options <a href="https://51degrees.com/pricing?...">here</a>. The examples print that answer to a console, where the HTML is shown as written. The Device Detection helper's anchor wrote its separators as&, so the address was wrong even when copied. The IP Intelligence helper also logged a once-only advisory,PRICING_MESSAGE, pointing at the pricing page.The specification,
device-detection-specification/required-examples.mdlines 105 to 113 at d79bbe3b, says "Where the data file in use has no value for one of them, the example says that the Property needs the Enterprise Data File, rather than leaving it out or showing a default value, and once in its output gives a link to the 51Degrees contact page to ask for a copy. The link the example writes carriesutm_source=code,utm_medium=example, the language repository's name asutm_campaignand the example's file asutm_content, so that an enquiry can be traced to the example that prompted it." This draft fixes the HTML and the pricing page. Giving the link once, tagged with the example's file, is #210.What changed
Links are to the head, 3afe55c8.
PropertyHelper.tryGetmethods answer in plain text with the contact link. Device Detection and IP Intelligence now give "The property 'X' is not available with the data file or resource key in use. Contact us about one that has it at" followed by the contact link, taggedutm_source=code,utm_medium=example,utm_campaign=51degrees-java, the helper's file asutm_contentand the existingutm_term.PRICING_MESSAGEnow says that some properties are not available with a free resource key or the free data file and gives the contact link withutm_term=paid-properties, where it gave the pricing page withutm_term=pricing_message. The constant keeps its name.Examples only. No published package changes, and no public name is removed or renamed.
Before you upgrade
The Device Detection web examples, through
HtmlContentHelper, and the IP Intelligence cloud and cloud mixed web examples put the answer into their page as it is, so on those pages a missing Property now shows the contact link as text where it showed a "here" link to the pricing page. The console examples, which are most of the callers, print it as a link a terminal can open.Tests
PropertyHelperMissingPropertyTests, new in both example shared modules, has the helper read a Property that throwsPropertyMissingExceptionand checks the answer holds no HTML (<or&), names the Property and holds the tagged contact link. The IP Intelligence class also checksPRICING_MESSAGEholds the contact link and no HTML.Red and green, run 43903389104 on
tmp/red-dx31, which runs the new class against the published packages from each example tree, at the test commit effb54f and at the fix 3afe55c.&separatorsBuild
The draft changes only the two example trees, so it runs the tests of what it touches, being the new classes' red and green above, and the full build runs once on
rcbefore a release. All seven checks on the head passed, being the four fresh clone checks, which build both example trees against the published packages on Ubuntu and Windows, the environment variable name check, the UTM link lint and the rc into main check.Base branch
Branched from
rc81e3d4a.What remains
unwrapValuein the same IP IntelligencePropertyHelper. The two touch different methods and a trial merge is clean.tryGetwere not run here to read the line they print, because each needs a key or the Enterprise data file to reach a missing Property. The test reads the helper's answer directly.Changes at this head
The draft is two commits on
rc81e3d4a.PropertyHelperMissingPropertyTestsin both example shared modules holds that a missing Property is answered in plain text with the tagged contact link, as Tests says. Red in run 43903389104.PropertyHelper.tryGetmethods and the IP IntelligencePRICING_MESSAGEgive the contact link in plain text, as What changed says. Green in the same run.The link is still given in every missing Property's answer and tagged with the shared helper's file, as it was on
rc. The specification asks for it once in an example's output, tagged with the example's file, which changes the output of every example that reads through the helpers, so it is left to #210 (What remains item 4).