Conflicts:
- iot-hub-version.models.ts: #16165 added creatorVerified to the old inline
toQuery(); it now sits at the end of filtersToQuery().
Also drops the ItemType.DASHBOARD entry from itemTypeColors, since #16255
removed the Dashboard item type.
From the #16148 review round of 2026-10-09:
- A failed popup request is carried as null and sets searchFailed, which
shows a "Network or server unavailable" row instead of "No results found".
- distinctUntilChanged() is gone from the popup pipeline. onSearchInput sets
searchLoading on every keystroke, so a debounced value equal to the last
one (type a letter and delete it within 300 ms) was dropped and the spinner
never cleared; it also kept a failed query from being retried as-is. This
matches thingsboard.io#706.
- The search page's resize handler captures the first visible item before
measureCols(), which already resets pageSize when the old size is not among
the new options; the grid now stays on the page holding that item.
* feat: filter the IoT Hub catalogue by the creator's verification status
Adds a "Verified creators only" control to every IoT Hub filter panel the
platform renders: the catalogue page, the embedded browse a dialog opens, and
the widget picker in the dashboard editor. It applies through the new
creatorVerified parameter on /api/versions/published, so the result count and
the page count reflect it rather than only the rows on screen, and it joins the
rest of the panel's state - chips, the count on the filter button, "Clear all",
and the reset that happens when the mode changes.
The control is a single checkbox above the facets rather than a section of its
own: one boolean has no list to collapse, and a one-option accordion reads as a
heading whose section never grows. The catalogue's sidebar had no name for its
panel at all, which left that checkbox sitting under nothing, so the sidebar now
carries the same "Filter" title the drawer has, with the same rule under it.
The parameter is matched, not switched, the shape peOnly/ceOnly already have:
creatorVerified=false means "only *un*verified". An unchecked control therefore
omits it entirely and never sends false - MpItemVersionQuery.toQuery() writes
the parameter only when the option is true, and both panels pass undefined
rather than false.
Two surfaces need the facet applied by hand. "Installed from IoT Hub" filters a
cached list in the browser instead of asking the server, so it gets the same
predicate locally; without it the panel would offer the control and the list
would not move. And the widget picker's category landing passes the parameter
to /api/item-listing/widgetCategories, so it stops offering a category whose
only widgets the grid then hides - which is also why the filter button is now
shown on the landing while the flag is set, the one place the panel is
otherwise hidden and the filter would have been unclearable.
The creator page and the search page run the same reads through a component
with no filter panel, so the parameter never reaches them.
Copy names what it filters - the creator's verification status - and claims no
quality tier.
* IoT Hub verified filter: address review comments
- Show only the verified checkbox in the widget-select filter panel on the
category landing; the other facets are ignored there
- Badge on the landing counts only the verified filter
- Pass the verified flag as-is; the query builders already drop false
- Align the sidebar filter title weight with the drawer header (500)
- Trim explanatory comments
* IoT Hub browse: share the filter checkbox rule with the standalone checkbox
Put the standalone class on the mat-checkbox itself, inset it with a
margin and drop the wrapper and the duplicated hover block.
Clicking a step in the stepper header bypassed nextStep(), so the
Provisioning step was never activated and rendered empty, and the
Configuration form values were not collected. Step activation now runs
on the stepper selectionChange, and instruction steps are marked
completed once shown so the header can move past them like the Next
button does.
* Remove IoT Hub Dashboard item type
The IoT Hub no longer has Dashboard items, so drop the DASHBOARD item type
from the platform: install/update/checksum/delete handling and the
DashboardInstalledItemDescriptor on the backend, and the item type, the
/iot-hub/dashboards page and route, deep links, translations and styles in
the UI. Dashboards created by device packages and solution templates are
not affected.
* Keep DashboardInstalledItemDescriptor for existing installed items
Installed-item rows with a DASHBOARD descriptor may still exist on
instances that were connected to the QA Hub. Without the subtype Jackson
fails on such a row and the whole Installed items page breaks, so keep the
descriptor and the delete branch to let those rows be read and removed.
* Revert "Keep DashboardInstalledItemDescriptor for existing installed items"
This reverts commit 61246776fa. A DASHBOARD installed-item row can only
exist on instances connected to the QA Hub; production and official
releases never had Dashboard items, so the legacy descriptor is not kept.
From the #16148 re-review:
- onIotHubSortChange compared the picked option with the effective sort, so
picking "Most installed" while it was already shown as the Installed list's
fallback for relevance stored nothing, and the IoT Hub list reopened on
"Most relevant". The choice is now always stored; the list reloads only
when the effective sort changes.
- INSTALLED_SORT_OPTIONS moves below the imports.
- The search page's load pipeline carries a failure as null and applies the
result in applyResult() instead of an inline block with a { result } wrapper.
- filterByLabel trims the search itself, so the facet list and the type pages
treat a trailing space alike.
- isCompactItemType() now also backs TbIotHubBrowseComponent.isCompactType and
the detail dialog's isCompactLayout; the home component's pass-through
becomes a readonly alias.
From the review of the search page:
- No Type facet selected now sends the six types the platform surfaces, as the
popup does, instead of every type the Hub holds: without the old grouping
step a published dashboard would have rendered as a card and been counted.
- Every reload goes through one Subject + switchMap, so a newer request
cancels an older one; toggling two facets quickly can no longer leave the
grid on the first answer.
- The ResizeObserver callback runs inside NgZone.run, as in
TbIotHubBrowseComponent; zone.js does not patch ResizeObserver, so a reload
started from it did not render. Checked: widening the window reloads with
the larger page size and renders it with no other event.
- The facet list takes option keys (string[]) and computes its visible list
once per change instead of on every change-detection pass; the Type facet's
placeholder zero counts and the facet count summing are gone.
- Shared in iot-hub-utils: filterByLabel (behind filterIotHubItemsBySearch),
measureGridColumns (used by this component and the browse page), and
IOT_HUB_FILTER_SCROLL_THRESHOLD in place of the literal 8 in both panels.
- The page padding and the component's pull-out margin derive from one
--tb-search-page-pad per breakpoint. Resize fields sit with the other state.
- Comments trimmed to the non-obvious intent.
Enter in the field opens the search page unless the autocomplete has just used
the press to select a highlighted row, which it marks with preventDefault in
its own keydown handler, registered before the field's. The field now listens
on keydown.enter and checks event.defaultPrevented, which replaces the
enterHandledByRow flag, the four places that reset it, and the read of the
trigger's activeOption at one exact moment. Checked in a browser: arrow + Enter
on a row opens the row only, Enter in the field opens the search page, click a
row / close the dialog / click the magnifier opens the search page, and arrow
to the footer + Enter opens it once.
Also from the review:
- The popup asks for the six cross-type types rather than filtering dashboards
out afterwards, so totalElements is exact and "See all N" needs no arithmetic.
- Row and footer selection go through onRowSelected / onFooterSelected instead
of a side-effecting predicate in the template.
- isCompactType delegates to the shared isCompactItemType; comments trimmed.
That list is sorted in the browser, and relevance is a score only the Hub
computes: sortInstalledVersions read a 'relevance' field no row has, so "Most
relevant" left the list unsorted under a label saying otherwise. The Installed
list now offers the other three keys, and a relevance choice made on the IoT
Hub list falls back to the first of them there. The sort is kept by value
rather than by menu index, since the two lists differ in length.
From the review:
- iot-hub-api.service builds peOnly/tbVersion from one platformScope(), used
by applyPlatformFilters and by the reads that wrote the pair into the URL by
hand (filterInfo, widgetCategories, the listing item-version lookup).
- DEFAULT_ITEM_TYPE_COLOR names the grey the palette falls back to; the
alarm-rules-unavailable page reads itemTypeColors instead of its own copy.
- isCompactItemType() next to CROSS_TYPE_ITEM_TYPES, used by the item card and
the popup.
- A stale "shared by both query shapes" comment left from the grouped query,
and other comments, trimmed to the non-obvious intent.
The popup asked /api/versions/published/grouped and rendered one section per
item type, so a query answered best by a widget still opened on devices. It now
asks for page 0 of the flat read the search page makes (relevance sort, 10
rows) and renders those rows in the server's order, so the best match leads
whatever its type.
- Each row names its type before the author ("Widget · pinkevych.d"), in the
type's colour with its itemTypeIcons icon. The verified mark moves in front
of the author like on the item cards; an unverified author keeps the person
icon.
- Items without a screenshot (calculated fields, alarm rules, rule chains) sit
in the same 99x56 frame as a screenshot with a 36px coloured tile inside, so
names line up down the list.
- The footer says "See all N results for ..." when the search matched more than
the popup shows; N discounts the rows this page dropped (dashboards).
- itemTypeColors joins itemTypeIcons as the one type palette; the hero reads it
instead of repeating the six colours.
Removes getPublishedVersionsGrouped, MpItemVersionGroupedQuery,
MpItemVersionSection and the iot-hub.section-more key.
Fixes the XSS sanitizer bypass in DOM.sanitize() (GHSA-jrc7-96c5-q579,
maplibre-gl <= 6.4.0).
- v6 removed the internal map.transform: sync the GL map with Leaflet
through the public jumpTo() and detect resizes from the container size
- v6 is ESM-only and the worker must be registered via setWorkerUrl():
copy maplibre-gl-worker.mjs and its maplibre-gl-shared.mjs dependency
to assets/maplibre-gl/
* Add API key support for CARTO basemap layers
* Move CARTO basemaps to a dedicated map provider and drop legacy HERE v2 credentials
- Add MapProvider.carto with its own layer types, settings and TbCartoMapLayer;
the API key is optional since CARTO serves tiles without one.
- Read CARTO layers stored under the OpenStreetMap provider as CARTO layers
(normalized in the layer factory and in the map layers settings form),
so existing widgets migrate on the next settings save without an upgrade script.
- Reset the API key when switching to CARTO instead of keeping the previous provider's key.
- Remove the useV3 toggle and app_id/app_code fields from legacy HERE settings;
leaflet-providers 4.x only supports HERE v3 with an API key.
---------
Co-authored-by: Vladyslav Prykhodko <vlad.pryhodko@icloud.com>
* Refresh the installed items count after an install, update or delete
The IoT Hub items page loaded its installed-items counter once, so installing,
updating or deleting an item from the embedded browse list left the counter
showing a stale number until the page was reloaded.
The browse component now emits installedItemsChanged whenever it refreshes its
own installed-items state, and the page reloads the counter on that event.
* Refresh the installed items count from the device wizard and deep links too
The device install wizard registers the install as soon as the entity steps
finish, but closing it with the header X or with Cancel on a still-pending
later step resolved to false, so the caller never reloaded. It now reports
'installed' once the server has the installed item, whichever way it is closed.
The deep-linked item dialog is opened by the items page itself, so its outcome
was discarded. It now refreshes the browse grid, which in turn announces the
new count.
* Keep IoT Hub markdown table columns from overlapping
Long unbreakable values in solution instruction tables (logins, e-mails,
passwords) overflowed their own column and ran under the copy icon.
Cells now break such tokens with overflow-wrap: anywhere, cells holding a
copy button reserve room for the icon, and the table is sized by its
content instead of splitting the width equally between all columns.
* Let preformatted content in markdown table cells wrap
With auto layout a cell holding a preformatted block keeps the whole line as its
min-content width, which the table cannot shrink below: in a 396px host the table
measured 701px and a host that hides horizontal overflow, such as the item detail
dialog's .dlg-body, cut the overflow off with no way to scroll to it. Relaxing the
block and the code inside it to pre-wrap lets the cell shrink with the table.
* Derive the copy icon space in table cells from the icon geometry
The 44px reserved on the right of a copy-code cell was derived by hand from the
copy icon chip declared 45 lines above it, so nudging the chip's width or offset
would silently put the cell text back under the icon. Both numbers now live in
$copy-icon-width and $copy-icon-offset, used by the chip itself and by the
reservation, which is written as width plus the gap on either side.
The flag was set by any user selection, but only the keyboard leaves a second half to
deal with: the trigger acts on keydown, the field's own handler on keyup, and
preventDefault on the first does not stop the second. A pointer selection is finished
when it returns, so the flag stayed set with nothing to consume it, and the next
onSearch took the early return - click a result, close the detail dialog, press the
magnifier, and the search page did not open. The magnifier is the plain case because
it calls onSearch with no keystroke at all; Enter in the field does the same once the
dialog restores focus there.
It is armed from the trigger's activeOption now, which is readable only at that moment
- the trigger holds it while it calls _selectViaInteraction and clears it on the next
line of its own handler - and which a pointer never sets. Focusing the field and
clearing it drop the flag as well, which covers the one pointer selection that can
still arm it: arrowing to a row and then clicking a different one.
Three things from the re-review, two of them introduced by the commit that turned the
popup's header and footer into options.
**The Enter guard never fired.** It asked the autocomplete trigger for its active
option during keyup, but the trigger clears that inside the same keydown - it calls
_selectViaInteraction and then _resetActiveItem, which with no autoActiveFirstOption
sets the active index to -1. So the guard always fell through, and one Enter on a
highlighted row opened it and then navigated away from it. That is worse than the
behaviour before, where the click handler simply never ran. The row that acts now
records it through rowSelectedByUser, which does not depend on the order the two
handlers run in, and typing clears the flag since a pointer selection leaves no keyup
behind it.
**The header's own padding was overridden.** Under one ancestor chain,
`.mat-mdc-option.tb-search-popup-group-header` and
`.mat-mdc-option:not(.mat-mdc-option-multiple)` both weigh (0,4,0), and the second was
declared later, so every section header shipped 8px taller than the 4px the comment
above it documents - with up to six of them in a 424px panel. The catch-all could not
match the old span header; it matches an option. Each row kind now carries its own
class and the shared parts sit in one rule, so nothing here rests on source order. The
footer had the same collision and only won by being declared last.
**The hover-scrollbar block is a mixin.** This branch added a second byte-identical
copy of it. Both now call tb-iot-hub-hover-scrollbar from the partial they already
import. The mixin records what is deliberately NOT settled here: whether these panels
should keep a thumb that is invisible until hover, and whether to add the standardised
scrollbar-width / scrollbar-color that Firefox reads, is a question for the IoT Hub
filter UI as a whole - iot-hub-browse and dashboard-widget-select carry the same
treatment and predate this branch.
onEdgeDisconnect persisted active=false based only on this node's in-memory
session map. When an edge drops and reconnects to a different TB-Core node, the
new node sets active=true while the old node writes active=false whenever it
finally notices its dead stream. If the stale write lands last, the edge stays
marked inactive while its gRPC session is alive.
That flag is not only a status indicator: saveEdgeEvent() consults it before
queueing any server-to-edge event, and actions that are not on the offline
allowlist - device and entity-group assignments among them - are dropped
outright rather than queued. A stale active=false therefore makes assignments
silently never reach the edge, with a full "Sync Edge" as the only recovery.
- Guard the write with the cluster-wide service-id cache, skipping it only when
another node is the recorded owner and that node is still a live TB_CORE
service. An absent entry means ownership is unknown, not claimed elsewhere, so
that case still persists the inactive state; and a node that died without
evicting its claim cannot leave the edge marked active forever.
- Publish the ownership claim before writing active=true in onEdgeConnect, so a
disconnect callback on the node the edge just left cannot read a stale owner.
- Only evict the service-id cache entry when it still points at this node.
A stale callback would otherwise wipe the live owner's claim and defeat the
guard above for any later disconnect.
- Remove the session atomically in onEdgeDisconnect. get() and remove() were not
atomic, so a session replaced between the two was dropped from the map, torn
down and marked inactive by the stale callback even though it was the live one.
LAST_DISCONNECT_TIME and the rule-engine DISCONNECT_EVENT are intentionally left
unguarded - they are accurate statements about this session, and the timestamps
are the main diagnostic signal for flapping edges.
Backport of thingsboard/thingsboard#16155 to lts-4.2, which has no disconnect
notification debounce and therefore none of the ownership helpers the 4.3 change
builds on; they are introduced here.
Activating any other root profile (skip-pkg, skip-pkg-without-*) switches off the
activeByDefault packaging profile, which held the only build-info execution, so such builds
had no build-info.properties and ProjectInfo failed at runtime. The jar plugin config
(logback.xml exclusion, manifest) moves out of the profile for the same reason.
The popup keeps focus in the input and walks its rows with an active-descendant key
manager, which only knows about options. A section header written as a span with
role="button" and tabindex="0" is therefore unreachable: the arrow keys skip it, its
keyup.enter can never fire because it can never hold focus, and Tab does not help
since leaving the input closes the panel. That header is the only way from the popup
into a type page, so without a mouse there was no way in at all. The footer had the
same shape, though its action is also on the input's own Enter.
The header also sat inside the group's label element, which is presentational, so the
section's name came out as the header's whole text - "Devices +12 more" - wrapping a
control nobody could operate.
Header and footer are now options like every other row. They take part in arrow
navigation, they read as part of the list, and the group wrapper goes away with the
label it was distorting.
Rows also acted on (click) alone. Pressing Enter on a highlighted result runs
_selectViaInteraction, which is not a DOM click, so the card never opened from the
keyboard. Every row now acts on (onSelectionChange) guarded by isUserInput, one path
for pointer and keyboard both.
Enter in the field needed a guard to go with that: the trigger acts on keydown and
this handler runs on keyup, which the trigger's preventDefault does not stop, so one
Enter would have opened a result and then navigated away from it.