- 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.
After Back reruns the entity steps, the "use existing" mark of such an entity is gone from the install state, so the
server took it for the package's and a later update or Delete removed the user's own entity. The wizard no longer
tracks it, unless it created that entity itself earlier in the same wizard.
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.
- update-desc-device says again that the new devices get new access tokens
- an existing entity the wizard created a moment ago is recorded as created, not use-existing
- the close prompt shows only after the removal, a partial removal or a lost answer
- query params go through InterceptorHttpParams (also fixes force losing the interceptor config)
- one iotHubErrorMessage helper on parseHttpErrorMessage for the iot-hub dialogs
- removingReplaced is one signal, stepError a field, no template method calls or extra detectChanges
- fewer comments, readonly fields in the update dialog, cdr renamed to cd
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.
- 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.
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.