It was the last class of the CE code to use @PostConstruct and @PreDestroy of javax.annotation-api, which is licensed CDDL-1.0 or GPL-2.0 with the Classpath exception. Spring handles the jakarta.annotation ones the same way, as in the rest of the code.
The fork was adopted for the frequency and presence penalties of the Google GenAI models, which upstream 1.16.1 has. Of the fork's remaining changes, the modules ThingsBoard uses carry only three: AiServices features and an HTTP PATCH method that ThingsBoard does not reach, and a second setter for the content of Mistral AI messages. That setter conflicts with the one upstream added for the same purpose, so Jackson rejects every Mistral AI chat response with "Conflicting setter definitions for property content". Upstream parses both plain and reasoning responses.
- Make TbAbstractSubCtx.stop() final and move cancellation into a
protected onStop() hook, so subclasses cannot cancel outside the
lifecycle lock.
- Guard doFetchAlarms() instead of fetchAlarms(), so the refresh path
through cleanupOldAlarms() is covered too.
- Cancel dynamic-value subscriptions when an alarm count context stops.
- Make the stop-waits-for-registration test deterministic by waiting
for the stopper to queue on the lifecycle lock.
A subscription command can register subscriptions after its context was
stopped by a concurrent session cleanup, or create a context after the
session was already removed. The registrations then outlive the session
and keep answering alarm updates with queries whose results are dropped.
- Serialize TbAbstractSubCtx.stop() with subscription registration through
a lifecycle lock; registerSubscription() refuses stopped contexts and
sessions unknown to the websocket service.
- Route all context-owned addSubscription calls through registerSubscription().
- Skip alarm fetches on stopped contexts and ignore alarm and entity data
commands for sessions that are no longer registered.
- Add WebSocketService.hasSession().
- Unit tests for the registration guard and the stop/registration ordering.
- A dashboard of the package that a profile outside the package uses as its default dashboard, and a device profile of
the package that a firmware or software package refers to, refuse the update before anything is removed, as the
profile and the rule chain do.
- The refusal no longer says that nothing was removed: an earlier attempt may have removed part of the package.
- The GATEWAY_CONNECTOR step neither marks the gateway as created in this wizard nor tracks it: the connector is
attributes on the gateway. A gateway the user had and chose to use stays theirs after Back reruns the steps.
- The doc of packageOwnedEntityIds is back above it.
- Tests for the rule chain (root, default of another device or asset profile, default of the package's own profile),
the dashboard and the firmware.
The update removes the package's entities one by one. ThingsBoard refuses to delete a device profile that is the
default one or that devices outside the package use, and a rule chain that is the root one or the default rule chain
of a profile outside the package. Found after the dashboard and the device were gone, such a refusal left the package
half removed, and every Retry failed the same way. Now it is checked before anything is removed, and the update is
refused with a 400 that names what blocks it.
A failure after the removal has started is thrown without its cause: BaseController answers 400 for an
IncorrectParameterException cause, and a 400 tells the wizard that nothing was removed.
The server returns a 400 only for a refusal before anything is removed; a failure once removing started is an
IllegalStateException. The wizard asks before closing after any other failure, a proxy timeout too, without matching
the message text.
The server returns a 400 only for a refusal before anything is removed; a failure once removing started is an
IllegalStateException. The wizard asks before closing after any other failure, a proxy timeout too, without matching
the message text.
An entity the user chose to use as it was, on a name conflict, is not the package's: updating or deleting the package neither removes nor tracks it. The default device profile is one, and it cannot be removed, so it blocked the update. The update warning also says plainly that this version reinstalls a device package.
An entity the user chose to use as it was, on a name conflict, is not the package's: updating or deleting the package neither removes nor tracks it. The default device profile is one, and it cannot be removed, so it blocked the update. The update warning also says plainly that this version reinstalls a device package.
An entity that is not removed stays in the installed item and the removal fails, so the wizard shows the error and Retry removes the rest. Closing the wizard after the removal asks first, and the update warning says that the new devices get new access tokens.
An entity that is not removed stays in the installed item and the removal fails, so the wizard shows the error and Retry removes the rest. Closing the wizard after the removal asks first, and the update warning says that the new devices get new access tokens.
- The registration sends replaceInstalledItemId in the URL: HttpParams.set()
returned a plain HttpParams, which dropped ignoreLoading/ignoreErrors, so a
failed registration showed a toast next to the wizard's own error.
- The stepper header cannot go back while the installed version's entities
are being removed, like the Back button.
- A version from the Hub without its item is reported as such instead of a
NullPointerException.
- The wizard registers the entities it keeps from the moment they exist; the
second collection of the same ids before each registration is gone.
- The tests verify TbDeviceService.delete through the Device overload, as
4.4 and PE also have one for a DeviceId, so the test is the same file
everywhere.
- The registration sends replaceInstalledItemId in the URL: HttpParams.set()
returned a plain HttpParams, which dropped ignoreLoading/ignoreErrors, so a
failed registration showed a toast next to the wizard's own error.
- The stepper header cannot go back while the installed version's entities
are being removed, like the Back button.
- A version from the Hub without its item is reported as such instead of a
NullPointerException.
- The wizard registers the entities it keeps from the moment they exist; the
second collection of the same ids before each registration is gone.
- The tests verify TbDeviceService.delete through the Device overload, as
4.4 and PE also have one for a DeviceId, so the test is the same file
everywhere.
Review of the device package update:
- The update endpoint refuses device packages instead of removing them, so a
client that reads it as an update no longer reports success with nothing
installed.
- The wizard removes only the entities of the installed version
(installedItems/{id}/device/removeEntities, checked against the new version
first), right before it creates the new ones. The installed item keeps its
version until the wizard registers the new one on the same item
(device/register?replaceInstalledItemId), so closing the wizard never leaves
an item that claims a version that is not installed.
- Every registration (one per group of entity steps, and each Retry) updates
that one item and keeps tracking the entities it already tracks. A package
with several groups no longer gets an installed item per group.
- A failed registration is shown with Retry instead of being swallowed, and
no longer rolls the entities back; the step is done only once registered.
- The forms and the connection method start from what the user entered for
the installed version, when the value fits the new field.
- An entity of another tenant is never deleted for a package.
Review of the device package update:
- The update endpoint refuses device packages instead of removing them, so a
client that reads it as an update no longer reports success with nothing
installed.
- The wizard removes only the entities of the installed version
(installedItems/{id}/device/removeEntities, checked against the new version
first), right before it creates the new ones. The installed item keeps its
version until the wizard registers the new one on the same item
(device/register?replaceInstalledItemId), so closing the wizard never leaves
an item that claims a version that is not installed.
- Every registration (one per group of entity steps, and each Retry) updates
that one item and keeps tracking the entities it already tracks. A package
with several groups no longer gets an installed item per group.
- A failed registration is shown with Retry instead of being swallowed, and
no longer rolls the entities back; the step is done only once registered.
- The forms and the connection method start from what the user entered for
the installed version, when the value fits the new field.
- An entity of another tenant is never deleted for a package.
Updating an installed device package removed every entity it created and
installed nothing again, while the installed item showed the new version.
The update dialog now warns that the package is installed again and opens
the install wizard of the new version. The wizard removes the installed
version with its entities only when it starts creating the new entities,
so closing it earlier keeps the package as it was. The server removes the
installed item together with its entities, and the wizard registers the
new version when it is done. The entity-modified check is skipped for
device packages: their checksum was never computed, so it asked on every
update.
Updating an installed device package removed every entity it created and
installed nothing again, while the installed item showed the new version.
The update dialog now warns that the package is installed again and opens
the install wizard of the new version. The wizard removes the installed
version with its entities only when it starts creating the new entities,
so closing it earlier keeps the package as it was. The server removes the
installed item together with its entities, and the wizard registers the
new version when it is done. The entity-modified check is skipped for
device packages: their checksum was never computed, so it asked on every
update.