Repository navigation
Throw for a cloud property the response leaves out, as Location does - #143
Merged
Merged
Conversation
Reading a property the response's part does not hold, or a property of a product the response has no part for, throws PropertyMissingException. A null with no reason beside it carries the message Unknown.
The Device Detection and IP Intelligence cloud engines stored an entry with no value for a property the response did not hold, so reading it gave no value and no message. Now the property has no entry and reading it throws PropertyMissingException with its reason, as the Missing Properties section of the specification requires and as the Location cloud engine does. A null the response gives with no reason carries the message Unknown.
jwrosewell
marked this pull request as ready for review
November 15, 2026 10:35
This was referenced Nov 15, 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 Device Detection and IP Intelligence cloud engines add an entry to the Element Data for every property in their metadata, whether or not the cloud response holds it (
DeviceDetectionCloudEngineline 148 andIPIntelligenceCloudEngineline 160 atrcb33daa0). A property the response leaves out therefore reads as a value that "has no value" with a null message, where it should throwPropertyMissingExceptionwith a message saying why the property is not there.A null in the response with no
nullreasonbeside it also gives a null message (line 401 and line 602), sogetNoValueMessage()explains nothing.The Location cloud engine already does both, since #96. It skips a property the response leaves out (
GeoLocationCloudEngineline 149) and givesUnknownas the message of a null with no reason (line 191).What the specification says
properties.md at 706de1f0, "Missing Properties", lines 116 to 118:
The same page, "Null values", lines 54 to 63, keeps the two cases apart. "no value" is for a Property that "is present in the result, but the Flow Element has chosen not to set its value", and "attempting to access the value MUST throw an error/exception with a customizable message explaining why the value is not set".
cloud-aspect-engine.md at 706de1f0, "Processing", lines 84 and 85 and lines 98 to 100:
What changed
DeviceDetectionCloudEnginelines 150 to 155,IPIntelligenceCloudEnginelines 162 to 167). The response's names are lower case, so the property name is lower-cased in the root locale before the check. Reading a property the response left out then throwsPropertyMissingExceptionthrough the missing property service, which already gives the reason and its message. A response with no part for the engine still raises nothing while it is processed.nullreasonbeside it, or anullreasonthat is itself null, gives the messageUnknown, the constantUNKNOWN_NULL_REASONthat Location uses (line 403, line 604).No public name is added, removed or renamed.
Tests
Written first (commit 5577343), in each engine's
ProductMissingTests.ProductPresent_ResponseWithoutPart_PropertyIsMissingreplacesProductPresent_ResponseWithoutPart_NoValues. A response with no part for the engine is processed without an error, and reading a property throwsPropertyMissingException.ProductPresent_PropertyLeftOut_PropertyIsMissing. A response whose part holds another property but not the one read throwsPropertyMissingException.NullWithoutReason_MessageIsUnknown. A null with no reason gives the messageUnknown.The runs build the two cloud modules with the modules they need, on Java 17, and run
ProductMissingTestsandMissingPropertyHandlingTestsin both.rc23e0fc6 (5577343 with the workflow, a6b95aa): run 43615384488.ProductMissingTestsfailed 3 of 7 in each engine, being the three tests above, with "A PropertyMissingException should have been thrown" twice and "expected: but was:".MissingPropertyHandlingTestspassed 2 of 2 in each.rcb33daa0 is merged into this draft (merge commit af4ed38, no conflicts).Build
Run 43616533536 built af4ed38 merged with
rc(b33daa0) on nine configurations, Ubuntu x64 with Java 8, 11, 17 and 21, Ubuntu arm64 with Java 17, and Windows with Java 8, 11, 17 and 21, and every job passed.ProductMissingTestspassed 7 of 7 in both cloud engine modules in all nine jobs. Each of its tenSetting 'PullRequestSha'lines names af4ed38, and its Configure job printed "Left out 6 macOS entries".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.
A trial merge of the head with
rcat c2d982a, as it stood at 09:32 on 15 November, is clean.Before you upgrade
Reading a Device Detection or IP Intelligence cloud property that the cloud response did not hold now throws
PropertyMissingException, with a message giving the reason, as reading a Location cloud property already does. Before, it gave a value whosehasValue()is false and whosegetNoValueMessage()is null. A property the response holds as null still gives a value with no value, and its message is nowUnknownwhere the response gives no reason.What remains
Nothing for this change.