DeviceInstalledItemDescriptor.getUsedExistingEntities reads usedExistingEntityIds, or the install state of an install that has none. Update, delete and the delete dialog call it; the static helpers in DevicePackageEntities and both services are gone.
Installs made before 4.4.1 record the entities the user chose to use as they were only in their install state. The delete and the delete dialog read only usedExistingEntityIds, which those installs don't have, so they deleted the entities; update already fell back to the install state, as the 4.2 and 4.3 lines do. One implementation in DevicePackageEntities now serves update, delete and the dialog.
* Renamed the Tuya integration credential fields to Access ID and Access Secret, as in the Tuya Developer Platform
* Removed unused Access Key length translations
---------
Co-authored-by: Vladyslav_Prykhodko <vprykhodko@thingsboard.io>
The attributes updated notification is built from the saved typed entries,
so it marks the string entries that would read back as numbers in
typeCastDisabledKeys. Copy to entity view and the device profile parse it
with JsonConverter.attributesFromMsg and get the values the device has.
* IoT Hub device packages: the update service becomes DevicePackageService, ready to install too
* IoT Hub device packages: an install saves its entities and the installed item in one transaction
* IoT Hub device packages: an install keeps only entities the user chose, and its errors read for install too
* IoT Hub device packages: an install from a customer or a device group puts its device and dashboard there, in the same transaction
* IoT Hub device packages: an install never moves an overwritten device to another owner
* IoT Hub device install: the wizard checks every step first, asks about all conflicts at once and installs in one request
* IoT Hub device install: an overwritten device takes the package's credentials, a cancelled check installs nothing, one install is one request
* IoT Hub device install: no second check or install from the step header, Retry checks the package again, messages and comments fit install and update
* IoT Hub device packages: install and update share one plan, review and result path, with neutral names
* IoT Hub device install: the plan looks like the update review, with a footer to confirm warnings and no jump to Verify
* IoT Hub device install: the rows after an install say Created, Used existing, Overwritten or Created copy
* IoT Hub device install: no overwrite of a device or gateway, Use existing keeps the step attributes, Try again asks again about the failed choice
- At install a name conflict on a device or gateway offers only Use existing; the
server rejects an install that overwrites one. An overwrite keeps the device's
credentials, which are applied only to a created device.
- Use existing at install writes the step's server and shared attributes after
commit, as the browser install did.
- Try again at install keeps the conflict choices except the one of the failed step.
- The provisioning step label is translated; ca_ES and ar_AE get the install texts.
- Tests check that the audit log, the Hub install report and the attributes run
after commit.
* IoT Hub device packages: a test pins that an overwrite keeps the device's credentials
* IoT Hub device install dialog: cleanup after review
* IoT Hub device install: the conflict check resolves names from the plan, an install overwrite sends the version
- The pre-check resolves each step's template with the names the plan gives the
entities of earlier steps (alias -> name, in step order), not with outputs left
from a failed attempt, so a dashboard titled ${device.name} is checked under the
device's planned name and the first check and Try again agree. Placeholders known
only after the install, e.g. ${device.id}, stay. An update still resolves with the
installed entities. The request sent to the server is unchanged.
- The pre-check keeps the version of the entity it found (rule chain, dashboard,
converter, integration), and an install overwrite sends it as expectedVersion, so
the server rejects an entity changed between the check and the install.
- The conflict message names the existing entity, as a step's name can differ from it.
- The duplicate-key comment says the check runs before the plan is sent, and the
server checks too.
* IoT Hub device install: a device profile overwrite sends the profile's version
The names lookup has no version, so the pre-check reads the matched profile once and keeps its version for expectedVersion.
* IoT Hub device install: a device overwrite sends the device's version
The device lookup of the pre-check now keeps the version, as the other lookups do, and the state key comment says the duplicate check runs before the plan is sent.
* IoT Hub device install: pass the preview outputs instead of swapping entityOutputs
preCheckTemplates passes its preview outputs to resolveTemplateJson instead of temporarily replacing entityOutputs. Drops duplicated comments and redundant optional chaining in templateNameOf.
---------
Co-authored-by: Viacheslav Klimov <vklimov@thingsboard.io>
Co-authored-by: Vladyslav_Prykhodko <vprykhodko@thingsboard.io>
Nodes call JsonConverter.attributesFromMsg / telemetryFromMsg / sortedTelemetryFromMsg,
which read the type-cast-disabled keys from the message metadata. The key-set overloads
become private. NoCastKeys is renamed to TypeCastDisabledKeys, and the related metadata
key, UplinkData, DedicatedUplinkData and proto fields to *TypeCastDisabledKeys, matching
JsonConverter's isTypeCastEnabled.
The platform guessed the kept strings from the values (STRING_V that
parses as a number). The guess was wrong for a decoder decimal with more
than 16 fraction digits, which the proto parser keeps as a string: it was
saved as a number before and became a string.
The typed converter already has the exact sets. UplinkData now carries
telemetryNoCastKeys / attributesNoCastKeys, and DeviceUplinkDataProto /
AssetUplinkDataProto get them as new repeated fields 8 and 9, so embedded,
remote and executor integrations pass them on. The platform and the
integration executor put them into the "noCastKeys" metadata as given. An
older remote integration sends none and is parsed as before.
NoCastKeys.fromKvList is removed.
PROD-9057
Typed LoRaWAN converters keep identifiers the network server sends as
strings (devAddr, eui, joinEui, hardwareVersion, ...) as strings, but they
were still saved as numbers: the platform turns the converter output back
into JSON for the rule engine, and the save nodes parse that JSON again
with type cast on, so joinEui "0000000000000000" became 0 and
hardwareVersion "1.0" became 1.0.
When the platform builds the rule engine message from an integration
uplink (device and asset paths, and the integration executor), it now
puts the keys whose string values look like numbers into the metadata
key "noCastKeys" as a JSON array. The converter already cast every other
numeric-looking string, so these are exactly the strings it kept. The
save attributes, save time series, calculated fields, copy attributes to
entity view and device profile nodes leave those keys uncast. Messages
without the key are parsed as before.
JsonConverter gets convertToAttributes/convertToTelemetry/
convertToSortedTelemetry overloads with a set of no-cast keys; the
existing methods do not change. NoCastKeys in common/proto writes and
reads the metadata key.
PROD-9057
* Serve pre-compressed UI files from the monolith again
Spring Boot 2.4 renamed spring.resources.chain.* to spring.web.resources.chain.*,
and Spring Boot 2.6 stopped binding the old keys. Since ThingsBoard 3.4 the
monolith has silently ignored compressed: "true" and served every UI file
uncompressed, although ui-ngx still builds the .gz copies.
Use the current keys. The content version strategy is dropped rather than
renamed: if enabled it rewrites url() references inside CSS files, which the
UI never relied on (esbuild already hashes the file names).
* Mention brotli copies in the resource chain description
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.
* fix(dashboard): hide the side menu toggle in the mobile app
A dashboard with both the dashboard toolbar and the main toolbar hidden shows a floating menu button at phone width that toggles the side navigation. In the mobile app the page runs in forced fullscreen, where the side navigation is disabled, so the button did nothing and covered the start of the first widget title. The app has its own navigation, so the button is no longer rendered there.
* fix(dashboard): visible toolbar icons in mobile app with primary shell
In the mobile app the dashboard toolbar is drawn on a white background. With the primary application shell the toolbar text colour is the primary contrast colour, which is white for dark palettes, so the time window and other toolbar icons were white on white. The dashboard toolbar now uses the light shell colours in the mobile app regardless of the selected application shell.
* Restamp license headers flagged by check-license-headers.sh
---------
Co-authored-by: Artem Babak <ababak@thingsboard.io>
- 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.
Migrations started from @PostConstruct ran before Spring registered
@TransactionalEventListener methods, so cache evict events published by
migrations were dropped. With a Redis cache the stale entry survived until
its TTL (e.g. the internal Trendz API key kept its pre-migration
permissions for up to 24 hours).
Start the patch applier on ApplicationReadyEvent with the new
AfterStartUp.SYSTEM_PATCH order (0), so it is still submitted before
partitions, discovery, core and actor startup.
Browsers send a quote in a multipart file name as %22, and it was stored literally in the file name, title and resource key. The UI then encoded the key as %2522, which the HTTP firewall rejects. Uploads of images, resources and OTA packages now decode %22 back to a quote.
The Content-Disposition header was built as "attachment;filename=" + name
without quoting, so a comma in the name made Chrome see multiple
Content-Disposition values (ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION).
Build the header with Spring's ContentDisposition via a shared
BaseController.toContentDisposition helper in image, resource, OTA package
and report downloads.