Repository navigation
Answer a missing Property in the examples with the contact link in plain text - #193
Draft
jwrosewell wants to merge 2 commits into
Draft
jwrosewell wants to merge 2 commits into
jwrosewell wants to merge 2 commits into
Conversation
This was referenced Nov 16, 2026
Draft
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 examples rule is that an example asks for what only the Enterprise data file or a paid key can give and, when the file or key in use cannot answer, prints the tagged link to https://51degrees.com/contact-us to ask about one.
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 under the decisions of 12 and 13 November it needs its quick checks rather than a full build. 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.