Repository navigation
Release candidate - #190
Merged
Merged
Conversation
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.
…ed cloud request this draft no longer needs
… and build the example links so the link lint can read them
[device-detection-specification/required-examples.md lines 90 to 96 at dbaf099c](https://github.com/51Degrees/specifications/blob/dbaf099c712e2bd3a2a80bfb4eaf284b079f05eb/device-detection-specification/required-examples.md?plain=1#L90-L96) says
`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.
# Conflicts: # AGENTS.md
…e examples' KeyHelper a second time
…c took two lines out of
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
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.
Java 4.6.2 for the 32 modules we publish. That's everything on
rcsince 4.5.130, the 13 November merge tomainincluded, 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
High,MediumandLowin any letter case, compared without trimming, whatever HumanConfidenceSource says, and51D_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 with51D_, in any letter case and including the name51D_alone, is sent to the cloud and is part of the key.FiftyOnePipelineBuilderadds 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 onuseResultsCacheorsetCacheSize.DeviceDatahas a typedgetServiceWorkers()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 implementsDeviceDatadirectly keeps compiling.HumanConfidenceElementgives HumanConfidence and HumanConfidenceSource in thederivedElement 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 sendssealedResultandtransactionto redeem, reads the redeem status into the newOutcome, and reads the Human Confidence Value a 51Did carries.HumanConfidenceClientredeems a sealed result outside a Pipeline.OutOfMemoryError(Pin cxx with the JavaTypes.i leak fix and regenerate the wrappers #284).IllegalStateExceptioninstead 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).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).Breaking changes since 4.5.130
This list compares
rcwith 4.5.130, tagged at f69da52e on 4 November 2026, so it covers the commitsmaingained on 13 November (#112), which were never published.Given a form that does not break in this release
FOD_CLOUD_API_URLis read again with a deprecation warning, and the renamed constants are back as deprecated (FIX: Keep 4.5 code compiling and starting #270).FlowData.getOrAdd(String, DataFactory<T>)returnsTagain (FIX: Keep 4.5 code compiling and starting #270).FlowElementBase.getDataType()andself()on the builder bases have default implementations, so existing subclasses compile (FIX: Keep 4.5 subclasses compiling and kept Element Data readable #273).TypedKeyDefault(String)is back, deprecated (FIX: Keep 4.5 subclasses compiling and kept Element Data readable #273).TypedKeyDefault(String, Class<?>)takes any class, with 4.5's type inference and the same compiled signature, so 4.5 code that gives the class of a generic type, such asList.classfor aList<String>key, or the class of an implementation for a key typed by its interface, compiles again. A value of another class held under such a key's name is removed, or replaced bygetOrAdd, as in 4.5, wherercthrew aClassCastException(FIX: Take any class as a typed key's type, as 4.5 did #278).FlowData.close(), as in 4.5 (FIX: Keep 4.5 subclasses compiling and kept Element Data readable #273).weightingbeside the new keys, as 4.5 did (FIX: Keep more 4.5 code compiling, starting and reading the same JSON #274). It does not writerawWeighting, because the specification requires lower-case keys (below).fod, rather than stopping the element building, and a missing minifier sends the script unminified (FIX: Keep more 4.5 code compiling, starting and reading the same JSON #274).-Dproject.rootis read again with a deprecation warning (FIX: Keep more 4.5 code compiling, starting and reading the same JSON #274).AggregateExceptionandFiftyOneAspectPropertyMetaDataDefaultare no longerfinal, and the sharedConstants()constructors are public again, deprecated (FIX: Keep more 4.5 code compiling, starting and reading the same JSON #274).getServiceWorkers()is a default method onDeviceData(FIX: Give the ServiceWorkers getter a default in DeviceData #266).Still breaking
/51dpipeline/json, and the endpoints answer only that exact path, where 4.5 served any path ending in51Degrees.core.jsor51Degrees.core.json. A page, proxy or filter that only lets/51Degrees.core.*through stops getting client-side values, with no error.nullin 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.process()throwIllegalStateException(evidence, errors and new Element Data).IllegalStateException. Lazy loading has no effect, so a slow cloud fails inprocess().PropertyMissingExceptionon read, where 4.5 gave a result with no value.Pipeline.getFlowElements()returnsList<FlowElement<?, ?>>, so code that assigns it toList<FlowElement>does not compile.getElement(Class<T>)needsT extends FlowElement<?, ?>, and the aspect engine builder bases needTEngine extends AspectEngine<?, ?>.close()no longer declaresthrows ExceptiononFlowData,FlowElement,Pipeline,FlowElementBaseandCloseableIterable, so a class that overridesclose() throws Exceptiondoes not compile. Callers are not hit.getJsonResponse(), not fromprocess().AUTO_UPDATE_TIMEOUT,AUTO_UPDATE_TEMP_PATH_NOT_SETandAUTO_UPDATE_UNKNOWN_ERRORare returned where 4.5 returnedAUTO_UPDATE_HTTPS_ERRorREFRESH_FAILED.CloudRequestFailedreason, noDataFileUpgradeRequiredfrom cloud engines, and new message texts.Floatto 3 decimal places, JSON Buildererrorsis a list, the JavaScript Builder minifies by default, the web examples listen on port 5151, and each Maven module has its own version._51DEGREES_environment variable names are read, apart fromFOD_CLOUD_API_URLandproject.rootabove. 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.rawWeightingfor a weighted value, which 4.5 wrote, because the specification requires every key in lower case (weighted-values.md, Serializing). Page code readsrawweightinginstead (FIX: Keep more 4.5 code compiling, starting and reading the same JSON #274).evalandargumentsare replaced byfod, with a warning, where 4.5 used them (FIX: Keep more 4.5 code compiling, starting and reading the same JSON #274).query.humanconfidence,DerivedPropertyElementgivesMediumand 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).PipelineBuilderBaseis F-bounded,FiftyOneStringSubstitutorisfinal,TypedKeyDefault(String, Class<?>)throws for a null class,AspectEngineBase.getExecutor()returns null,MissingPropertyReason.Unknown's ordinal moves from 4 to 5,setCacheonHardwareProfileCloudEngineBuilderis ignored, and the test helper constants are gone.ProcessId, header fields hourly, escaping, an Evidence limit of 10000), and three query string setters now do nothing, with no warning.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).ClassCastException.IllegalStateException(IllegalStateException, not a native call, once the engine's closed #285) and a null string throwsNullPointerException(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
NullPointerExceptioninstead 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
Every pull request merged into rc since 4.5.130