Skip to content

Throw for a cloud property the response leaves out, as Location does - #143

Merged
jwrosewell merged 3 commits into
rcfrom
fix/cloud-missing-property
Nov 15, 2026
Merged

jwrosewell merged 3 commits into
rcfrom
fix/cloud-missing-property

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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 (DeviceDetectionCloudEngine line 148 and IPIntelligenceCloudEngine line 160 at rc b33daa0). A property the response leaves out therefore reads as a value that "has no value" with a null message, where it should throw PropertyMissingException with a message saying why the property is not there.

A null in the response with no nullreason beside it also gives a null message (line 401 and line 602), so getNoValueMessage() explains nothing.

The Location cloud engine already does both, since #96. It skips a property the response leaves out (GeoLocationCloudEngine line 149) and gives Unknown as the message of a null with no reason (line 191).

What the specification says

properties.md at 706de1f0, "Missing Properties", lines 116 to 118:

When the user attempts to access a Property that is defined for an Engine, but does not exist in the result set for some reason, the system MUST throw an error/exception with a message explaining why the Property is not available.

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:

Where the response JSON has no portion for the Engine's Data Key, the Cloud Aspect Engine leaves the Element Data without values and raises no error.

If there is no value in the JSON, Look for a JSON Property with the same name suffixed with nullreason. Use this value to set the NoValueMessage on the instance.

What changed

  1. Both engines add an entry only for a property the response holds (DeviceDetectionCloudEngine lines 150 to 155, IPIntelligenceCloudEngine lines 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 throws PropertyMissingException through 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.
  2. A null with no nullreason beside it, or a nullreason that is itself null, gives the message Unknown, the constant UNKNOWN_NULL_REASON that 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_PropertyIsMissing replaces ProductPresent_ResponseWithoutPart_NoValues. A response with no part for the engine is processed without an error, and reading a property throws PropertyMissingException.
  • ProductPresent_PropertyLeftOut_PropertyIsMissing. A response whose part holds another property but not the one read throws PropertyMissingException.
  • NullWithoutReason_MessageIsUnknown. A null with no reason gives the message Unknown.

The runs build the two cloud modules with the modules they need, on Java 17, and run ProductMissingTests and MissingPropertyHandlingTests in both.

  • Red, the tests on rc 23e0fc6 (5577343 with the workflow, a6b95aa): run 43615384488. ProductMissingTests failed 3 of 7 in each engine, being the three tests above, with "A PropertyMissingException should have been thrown" twice and "expected: but was:". MissingPropertyHandlingTests passed 2 of 2 in each.
  • Green, the fix (09f0823 with the workflow, 63f668a): run 43615399950. All 18 tests passed.

rc b33daa0 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. ProductMissingTests passed 7 of 7 in both cloud engine modules in all nine jobs. Each of its ten Setting '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 rc at 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 whose hasValue() is false and whose getNoValueMessage() is null. A property the response holds as null still gives a value with no value, and its message is now Unknown where the response gives no reason.

What remains

Nothing for this change.

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
jwrosewell marked this pull request as ready for review November 15, 2026 10:35
@jwrosewell
jwrosewell merged commit 4e537d3 into rc Nov 15, 2026
3 checks passed
@jwrosewell
jwrosewell deleted the fix/cloud-missing-property branch November 15, 2026 10:35
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