Skip to content

Release candidate - #190

Merged
jwrosewell merged 396 commits into
mainfrom
rc
Dec 4, 2026
Merged

jwrosewell merged 396 commits into
mainfrom
rc

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Java 4.6.2 for the 32 modules we publish. That's everything on rc since 4.5.130, the 13 November merge to main included, since nothing from it was ever published. Release build at a5002067 passed.

Biggest new thing is Human Confidence, through the Human Confidence element in a Pipeline, or the 51Did client. The cloud results cache got a lot stricter about what it keeps, and the on-premise engines throw now where they used to crash. Example modules are off Maven Central.

Expect breaking changes. The default cloud timeout is 2 seconds now, for one. List is under the release notes.

Thread safety (release note)

How a Flow Data and its results behave when more than one thread uses the same instance was not defined before this release. From this release both are explicitly not thread safe. The caller is responsible for coordinating multi-threaded access to a Flow Data and to its results, for reads as well as writes.

Warnings (release note)

Warnings are errors in our own builds only, so a customer's build shows warnings and never fails on one.

Changes for customers since 4.5.130

  1. The Cloud Request Engine's results cache never stores or serves a response made for one visitor (FEAT: Pass the cloud's page scripts and their answers through a server, and keep every response made for one visitor out of the results cache #265). A response is stored only once its request has finished and the response may be served, so a failed request is not stored either. That covers:
    • a request carrying a session id, a sequence, a JA4 or HTTP/2 settings, under any prefix and in any letter case,
    • a response carrying the browser tests' script, in any element,
    • a response carrying a sealed HumanConfidence result, being text that is not blank and is none of High, Medium and Low in any letter case, compared without trimming, whatever HumanConfidenceSource says, and
    • a response carrying a 51Did.
  2. 51D_ values are part of the cache key (FEAT: Pass the cloud's page scripts and their answers through a server, and keep every response made for one visitor out of the results cache #265). Every query and cookie value whose name starts with 51D_, in any letter case and including the name 51D_ alone, is sent to the cloud and is part of the key.
  3. A cache key holds each Evidence name and its value, in order (BUG: Key the cache on each Evidence name and value, in order #260). Two requests that differ in any Evidence name or value get their own keys, where before keys held only the values, compared in any order. The same Evidence added in any order, with names in any letter case, still gets the same key.
  4. In a web integration the results cache answers no request. FiftyOnePipelineBuilder adds the Sequence element by default, which gives every request a visitor's session id, so every request goes to the cloud. Results do not change. Expect more requests to the cloud where a Pipeline relied on useResultsCache or setCacheSize.
  5. The cloud's page scripts and their answers pass through a server (FEAT: Pass the cloud's page scripts and their answers through a server, and keep every response made for one visitor out of the results cache #265).
  6. A cache given to a cloud aspect engine, or to its builder, is ignored with one warning (FEAT: Cloud engines take their cache from the Cloud Request Engine #256). Code that does this keeps starting. The engine keeps no cache and the warning says to add the cache to the Cloud Request Engine. The cloud pipeline builders already put the cache there.
  7. DeviceData has a typed getServiceWorkers() getter (FEAT: Read ServiceWorkers through a typed getter #257), with a default (FIX: Give the ServiceWorkers getter a default in DeviceData #266), so a class that implements DeviceData directly keeps compiling.
  8. A usage sharing element anywhere but last is moved last, with a warning (FIX: Move a misplaced usage sharing element to the end instead of refusing the Pipeline #263). The last release's on-premise builders put it first. A Pipeline built that way, in code or from configuration, still builds, with the element run last and outside any parallel group, and one warning.
  9. HumanConfidence is only ever High, Medium or Low (FIX: Take HumanConfidence 0.10.0 and read stored text for boolean checks #267). The derived property script it comes from is 0.10.0, which gives no value where it cannot decide, rather than Unknown.
  10. The native code is built from cxx 58feca69 (BUILD: Build against cxx 152dd945 #271, BUILD: Build against cxx 4918ab92 #277, Pin cxx with the JavaTypes.i leak fix and regenerate the wrappers #284), the C and C++ code of the cxx release, which holds the fix for a crash on the first lookup after a cache fills.
  11. Human Confidence through the Pipeline, and in the 51Did client (Redeem Human Confidence in the Pipeline and read it in the 51Did client #275). The new HumanConfidenceElement gives HumanConfidence and HumanConfidenceSource in the derived Element Data, and redeems a sealed result that the page sends back, with the transaction the Cloud Request Engine kept for the page. The 51Did client sends sealedResult and transaction to redeem, reads the redeem status into the new Outcome, and reads the Human Confidence Value a 51Did carries. HumanConfidenceClient redeems a sealed result outside a Pipeline.
  12. A servlet that reads the results of an asynchronous request after the filter chain has returned finds them still there (FIX: Keep the Flow Data open until an asynchronous request completes #272, issue The servlet filter closes the Flow Data before an asynchronous request finishes #199). Nothing changes for other requests.
  13. A derived property script reads an on-premise IP Intelligence value that carries weights as its heaviest value (FIX: Read weighted stored text through the typed accessor #268), where it read the stored text, which matched nothing.
  14. A sealed result that is not redeemed during the recovery period says so in its reason (Give the recovery period's reason for a sealed result not redeemed #282).
  15. Refreshing an on-premise engine from a byte array no longer keeps a copy of the data file each time, and a native allocation failure raises OutOfMemoryError (Pin cxx with the JavaTypes.i leak fix and regenerate the wrappers #284).
  16. A call on a closed on-premise engine, or on metadata kept past close, throws IllegalStateException instead of ending the JVM, and closing waits for a running call. Each process call takes a read lock (IllegalStateException, not a native call, once the engine's closed #285).
  17. A null file name or IP address string throws NullPointerException, and a C++ exception, such as reading past the end of a component's properties, becomes a Java exception instead of ending the JVM (Pin cxx with the JavaTypes.i leak fix and regenerate the wrappers #284).
  18. Cloud typed getters read their own type before discovery completes (FIX: Give each cloud typed getter its own type before discovery #286). Where a getter declares the property, the value is read as that type, or has no value with a reason naming the property and both types.
  19. The 15 example modules are no longer published to Maven Central (BUILD: Stop publishing the example modules #281). Take the examples from this repository.

Breaking changes since 4.5.130

This list compares rc with 4.5.130, tagged at f69da52e on 4 November 2026, so it covers the commits main gained on 13 November (#112), which were never published.

Given a form that does not break in this release

Still breaking

  1. The default cloud timeout is 2 seconds, where it was 100 seconds. Any cloud answer slower than that fails the request. The cloud pipeline builders can now set it (FEAT: A recovery period for discovery, one discovery attempt at a time, and a 429 to discovery is temporary #269). Once 10 requests have failed discovery within 100 seconds, requests fail at once for a recovery period of 60 seconds by default, and a 429 answer to discovery no longer stops the build (FEAT: A recovery period for discovery, one discovery attempt at a time, and a 429 to discovery is temporary #269).
  2. Client-side JSON is served from /51dpipeline/json, and the endpoints answer only that exact path, where 4.5 served any path ending in 51Degrees.core.js or 51Degrees.core.json. A page, proxy or filter that only lets /51Degrees.core.* through stops getting client-side values, with no error.
  3. A property with no value is written as null in the JSON, beside its reason, where 4.5 left the key out. In the page, fod.<aspect>.<property> gives the reason text rather than undefined.
  4. Writes to a Flow Data after process() throw IllegalStateException (evidence, errors and new Element Data).
  5. Writes to Element Data after its element has finished throw IllegalStateException. Lazy loading has no effect, so a slow cloud fails in process().
  6. A cloud property the response leaves out throws PropertyMissingException on read, where 4.5 gave a result with no value.
  7. Pipeline.getFlowElements() returns List<FlowElement<?, ?>>, so code that assigns it to List<FlowElement> does not compile. getElement(Class<T>) needs T extends FlowElement<?, ?>, and the aspect engine builder bases need TEngine extends AspectEngine<?, ?>.
  8. close() no longer declares throws Exception on FlowData, FlowElement, Pipeline, FlowElementBase and CloseableIterable, so a class that overrides close() throws Exception does not compile. Callers are not hit.
  9. A Pipeline with only the Cloud Request Engine gets a failed request's error from getJsonResponse(), not from process().
  10. New data update statuses AUTO_UPDATE_TIMEOUT, AUTO_UPDATE_TEMP_PATH_NOT_SET and AUTO_UPDATE_UNKNOWN_ERROR are returned where 4.5 returned AUTO_UPDATE_HTTPS_ERR or REFRESH_FAILED.
  11. Missing property reasons and messages changed: a new CloudRequestFailed reason, no DataFileUpgradeRequired from cloud engines, and new message texts.
  12. The data file watcher runs with auto update off, so a file replaced on disk is reloaded without a restart.
  13. A configured cloud endpoint that redirects fails, where discovery and the 51Did client followed it (Redeem Human Confidence in the Pipeline and read it in the 51Did client #275).
  14. A Cloud Request Engine message that names the License Key shows none of it, where it showed the last 4 characters (Redeem Human Confidence in the Pipeline and read it in the 51Did client #275).
  15. Element Data and Evidence keys are not case sensitive, usage sharing runs last and shares less (Share every query value by default, and no cookie but 51D_ ones even when all Evidence is shared #160, Share a query or form parameter only when 51D_ or the Pipeline uses it #205), Latitude and Longitude are Float to 3 decimal places, JSON Builder errors is a list, the JavaScript Builder minifies by default, the web examples listen on port 5151, and each Maven module has its own version.
  16. Only the _51DEGREES_ environment variable names are read, apart from FOD_CLOUD_API_URL and project.root above. The table of old and new names is in Stop reading the deprecated environment variable names #213, and the renamed constants are in BUILD: Read every setting under one _51DEGREES_ name #220.
  17. The JSON Builder does not write rawWeighting for a weighted value, which 4.5 wrote, because the specification requires every key in lower case (weighted-values.md, Serializing). Page code reads rawweighting instead (FIX: Keep more 4.5 code compiling, starting and reading the same JSON #274).
  18. The JavaScript object names eval and arguments are replaced by fod, with a warning, where 4.5 used them (FIX: Keep more 4.5 code compiling, starting and reading the same JSON #274).
  19. On a request that carries query.humanconfidence, DerivedPropertyElement gives Medium and no source in place of its script's value, because it cannot redeem a sealed result (Redeem Human Confidence in the Pipeline and read it in the 51Did client #275).
  20. A 4xx answer with no body to a discovery request fails the build (Redeem Human Confidence in the Pipeline and read it in the 51Did client #275), where 4.5 completed the build. The specification requires it (cloud-request-engine.md, "How a discovery failure at build time is handled", which says a 4xx response "MUST fail the build"). A 429 or 5xx with no body still completes the build.
  21. IP Intelligence on-premise uses the Balanced profile by default, where 4.5.130 used MaxPerformance.
  22. Some API changes for code that extends the Pipeline: PipelineBuilderBase is F-bounded, FiftyOneStringSubstitutor is final, TypedKeyDefault(String, Class<?>) throws for a null class, AspectEngineBase.getExecutor() returns null, MissingPropertyReason.Unknown's ordinal moves from 4 to 5, setCache on HardwareProfileCloudEngineBuilder is ignored, and the test helper constants are gone.
  23. The usage sharing record changes (Content-Type, ProcessId, header fields hourly, escaping, an Evidence limit of 10000), and three query string setters now do nothing, with no warning.
  24. setDataUpdateOnStartup(true) with auto update off downloads at every start (FEAT: Read the product of a data file from its header on start-up #248).
  25. A typed getter asked for a type its property doesn't have throws ClassCastException.
  26. The example modules are not published (BUILD: Stop publishing the example modules #281).
  27. A closed engine throws IllegalStateException (IllegalStateException, not a native call, once the engine's closed #285) and a null string throws NullPointerException (Pin cxx with the JavaTypes.i leak fix and regenerate the wrappers #284), where 4.5.130 crashed. Nothing that worked breaks, but callers can see the new exceptions.

Known issue

Before the cloud service's property list has been fetched, for example after a failure at start-up that the build lets pass, a hardware profile lookup throws a NullPointerException instead of the 4.5 message saying the properties could not be loaded. Both versions fail the request in that state, and the fix comes after 4.6.2.

Issues this release closes

Closes #9. Closes #11. Closes #12. Closes #14. Closes #110. Closes #125. Closes #126. Closes #198. Closes #199. Closes #244.

Not in this release

  • #283 builds the examples against 4.6.2 once it is on Maven Central, and #253 runs every example's tests against Maven Central after Publish.
  • #242, published dates read as midnight, is deferred.

Every pull request merged into rc since 4.5.130

The Java packages differed from seven SHOULD sentences of the specification.
rc already carries the missing Property messages and the order the reason
is decided in, from #175, so the merge keeps rc's version of those six
files and this draft's own implementation of them goes, along with its two
test files for them, which rc covers with MissingPropertyMessageTests and
MissingPropertyReasonTests.
rc already moved the example tests and the example data file helper off the
packages' test helpers, in #175, so the merge keeps rc's version of those
and of the TacCloud key check. The two engine files keep this draft's
version, which adds the lock around every read of the native results and
only takes the position shortcut with one set of results. The device
detection cloud request failed test processes through the engine, as the
IP Intelligence one does, now that the engine leaves processing to the
shared logic.
rc moved the examples off the packages' test helpers in #175, so TacCloud
and UpdateDataFile take the key helper from the examples' own shared module
whilst keeping this draft's ending for an example run with no resource
key.
… and build the example links so the link lint can read them
`ShareUsageBuilderBaseTest` holds 32 tests of the usage sharing builder's setters, and none of them has ever run. The class uses JUnit 4 (`org.junit.Test`, `org.junit.Before`, `@Test(expected = ...)`), while its module, `pipeline/pipeline.engines.fiftyone`, depends on JUnit 5 alone ([pom.xml lines 61 to 64 at rc 23e0fc6](https://github.com/51Degrees/51degrees-java/blob/23e0fc649e97b290436f22eb0f6894002a9375f6/pipeline/pipeline.engines.fiftyone/pom.xml#L61-L64)). Surefire then runs the JUnit 5 engine only, and a JUnit 4 class there is passed over without a word. [#62](#62) noted that the class "did not run in any of the runs above".
…READMEs (#162)

Documentation only. AGENTS.md and the two example READMEs described how the examples behaved before the free data file and Find out more changes, so an agent or a person following them was told to pass the Lite file as an argument, to run from the repository root only, and to expect a pricing link.
The fresh-clone workflow built only the console examples, with their
tests compiled. A web example test that used a class the published
packages lack would not have failed it. The Ubuntu job now builds every
example module with its tests compiled, after it has saved the data file
for the other systems.
jwrosewell and others added 27 commits December 2, 2026 21:49
TypedKeyDefault(String, Class<T>) refused the class of a generic type,
such as List.class for a List<String> key, and the class of an
implementation for a key typed by its interface, both of which 4.5's raw
Class parameter took, so code written for 4.5 did not compile. The
parameter is Class<?>, which gives the same type inference as 4.5's raw
parameter, and the same constructor signature in compiled code.
TEST: Give the loaded engine a separate file with no header
A key may now be made with any class, so a value held under its name can
be of another class. removeIfExists returns that value without checking
it against the key's class, as 4.5 did, rather than throwing a
ClassCastException after the entry has been removed and its value closed.
putIfAbsent replaces a value of another class, as put does and as
containsKey treats it, so FlowData.getOrAdd with a typed key gives new
Element Data from its factory where the name holds data of another class,
as 4.5 did, rather than throwing.

Tests: the class of a generic type given with a diamond, a class given as
a wildcard, removal and putIfAbsent with a value of another class on both
maps, and getOrAdd with a typed key whose name holds another class. The
raw class test is dropped, as a raw class compiled before this change.
The one-argument constructor no longer needs a cast, and a stale comment
on the concurrent map is removed.
The live tests of a server's call checked which level and source the
cloud gives for which Evidence, which is the cloud's concern. One test now
makes the call with the visitor's Evidence passed on, as a server does,
and checks what the element gives: the level in the clear, being High,
Medium or Low, and the source, each as the cloud answered it, or the
cloud's reason where it answered no level.
putIfAbsent replaces a value of another class held for the name with one
compare and swap on the entry's value, so that of two threads replacing
it at once, both return the same value, that value is not closed, and the
value replaced is closed once. Before, it called put, which two threads
could both do, each closing the other's value.

The interface's default putIfAbsent reads the name through tryGet, so it
replaces a value of another class and keeps a null, as the map does, and
its Javadoc says so. New tests: the default through a map that leaves
putIfAbsent to it, a name not held, a null held, and two threads replacing
a value of another class in 10,000 rounds.
The live test now checks what the element gives for whichever form the
cloud answers in: a level in any letter case, a sealed result, a null
with or without a reason, or anything else. Names in the answer are read
in any letter case, and HumanConfidenceSource is checked against the
cloud's answer for it, its reason included. The request carries the same
Evidence as the device data test, so the test chooses nothing for the
sake of the answer.
The live Human Confidence test checked HumanConfidenceSource only where
HumanConfidence was a level. It now checks it against the cloud's answer
for every answer that is not a sealed result, as the element reads it for
all of those. A failure message shows the cloud's answer with any sealed
result replaced, so that a build log never holds one. The license key
helper's comment no longer says how the cloud treats the call.
…lient

Redeem Human Confidence in the Pipeline and read it in the 51Did client
FIX: Keep the Flow Data open until an asynchronous request completes
FIX: Read weighted stored text through the typed accessor
The check that the element gives only High, Medium or Low printed the
element's HumanConfidence when it failed, which is where a sealed result
passed through would show. That message now replaces a sealed result, as
the message showing the cloud's answer does, and the Javadoc says which
messages replace it.
Reading a Property that has no value throws, with the element's reason
in the message. The live Human Confidence test now checks that the
element gave a value before it reads one, so a failure says what was
missing. The Javadoc says plainly that no failure message shows a sealed
result.
FEAT: A recovery period for discovery, one discovery attempt at a time, and a 429 to discovery is temporary
…-only

TEST: Check what the Human Confidence element gives from a server's call
FIX: Take any class as a typed key's type, as 4.5 did
BUILD: Build against cxx 4918ab92
The test that no log entry holds any part of the License Key looks for
every four characters of the made-up key in each entry. The key ended
in 1234, and the error entry names the engine with its hash code, which
differs from run to run, so the test failed whenever that number started
with 123 or held 1234, with the code working as designed. The made-up
key and sealed result now hold no digits, so no number can match a part
of either.
TEST: Give the made-up License Key no digits
Where the Cloud Request Engine makes no request because discovery is
held back for its recovery period, a sealed Human Confidence result that
could otherwise be redeemed now gives HumanConfidenceSource the message
"No value: the Cloud Request Engine made no request, because it is in a
recovery period. Try again later.", and the transaction kept for its page
stays kept. No License Key, then no transaction kept, still come first.

The example, its README and page, the 51Did package's README and the
Human Confidence client's documentation say the Cloud Request Engine
redeems the sealed result.

Spec: https://github.com/51Degrees/specifications/blob/main/pipeline-specification/features/human-confidence.md
The Cloud Request Engine records that a request was held back only where
discovery refused it because the recovery period is running, so the
request whose own failed discovery starts the period gives the reason
for a failed request. The example's README names the Cloud Request Engine
as what needs the License Key to redeem.

Spec: https://github.com/51Degrees/specifications/blob/main/pipeline-specification/features/human-confidence.md
Give the recovery period's reason for a sealed result not redeemed
IllegalStateException, not a native call, once the engine's closed
@jwrosewell
jwrosewell marked this pull request as ready for review December 4, 2026 08:25
@jwrosewell
jwrosewell merged commit bfc0347 into main Dec 4, 2026
59 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment