partitionService is a mock, so an unstubbed getAllServiceIds() returns an
empty set and the known-id tests also passed through the fail-open branch.
Assert that a live member is accepted without consulting getAllServiceIds,
so the tests fail if the isKnownServiceId check is broken.
The recently-seen grace period and fails-open-on-unknown-topology paths
of isUnknownService were only tested for pushNotificationToCore. Mirror
those tests for pushNotificationToRuleEngine and pushNotificationToTransport
so a regression scoped to those service types doesn't slip through.
- Use the new isKnownServiceId() instead of getAllServiceIds().contains(),
avoiding two collection allocations on the common (live member) path.
- Reuse SetCache instead of a hand-rolled Caffeine cache for
recentlySeenServices.
- Drop pushNotificationToTransport's null/empty serviceId guard, now
redundant with isUnknownService() treating null/empty as unknown.
- Track skipped-due-to-unknown-service notifications in a counter and
surface it via the existing periodic stats log, since the point of
this guard is to catch a leak that was previously invisible.
getAllServiceIds() rebuilds two HashSets just to test membership of a
single id - PartitionService#isKnownServiceId scans the live service
lists directly instead, for the hot path in DefaultTbClusterService's
per-notification unknown-service guard. SetCache.boundedBySize() adds
an LRU-by-size variant alongside the existing TTL-based constructor.
The clusterService field is typed as the TbClusterService interface, which
does not declare onServiceListChanged (it is a concrete-class @EventListener).
Cast to DefaultTbClusterService in the recently-seen test so it compiles.
Make the unknown-service-id skip a lenient safety net rather than a
precise gatekeeper. A service id is treated as known if it is either a
current member (PartitionService.getAllServiceIds) OR a recently seen one.
The recently-seen set is a bounded (1024) LRU cache fed from
ServiceListChangedEvent, so a node that is briefly absent from the live
snapshot - discovery-propagation lag, rolling restart, transient
scale-down - still receives its notifications instead of having them
dropped; genuine non-delivery to a node that is actually gone is already
handled by the caller-side RPC/REST timeout. An id gone for good ages out
via LRU eviction and the guard tightens again.
The live-snapshot check stays authoritative for current members (discovery
events are change-only, so a pure recently-seen cache would go cold in a
quiet cluster); recently-seen only widens 'known', it never adds a new
drop. Adds a test for the offline-but-recently-seen path.
Follow the existing pushNotificationToTransport convention: a deliberate
skip to a non-member service id now completes the callback as a no-op
success instead of onFailure, so callers don't treat an intentional skip
as a delivery error. Aligns all three skip paths (core, rule engine,
transport) on one contract.
- Extend the unknown-service-id orphan-topic guard to pushNotificationToTransport
- Make HashPartitionService.currentOtherServices volatile (now read on the
per-notification path, written under the synchronized recalculatePartitions)
- Lower the per-skip log from warn to debug to avoid noise when stale service
ids appear in message metadata during normal operation
- Add tests for the transport guard (unknown skipped, known sent)
Per-service notification topics (<notifications-topic>.<serviceId>) are
auto-created by the Kafka producer on first send. pushNotificationToCore and
pushNotificationToRuleEngine forwarded the target service id as-is. That id may
come from message metadata (e.g. the originServiceId of RPC reply and
integration-downlink flows), so an id that does not belong to the cluster
created an orphan notification topic that no node ever consumes and that is
never cleaned up, growing the topic count without bound.
Validate the target service id against current cluster membership
(PartitionService.getAllServiceIds) before sending; when the id is not a known
TB_CORE / TB_RULE_ENGINE service, skip the push and report delivery failure on
the callback (the message was not delivered, so onFailure is the correct signal
and it also lets a waiting caller complete). The check fails open while the
cluster topology is not yet known (empty membership, e.g. right after startup)
so legitimate notifications are never dropped.
With the entity partitioning strategy, DummyTask.getEntityId() returns a new
random id per task, so the 200 tasks spread over many partitions and run in
parallel. 200 x 50 ms tasks could all finish within the fixed Thread.sleep(500),
so the cancel found nothing left to discard (discardedCount == 0).
Use 30 s tasks (60 s task timeout) so tasks are always in flight when the job
is cancelled, whatever the partitioning strategy, and cancel as soon as the job
is RUNNING. Cancellation interrupts running tasks (TaskProcessor.cancelRunningTasks),
so the test still finishes quickly. One test body covers both strategies.
The server accepts the WebSocket handshake and closes the session right
away when it rejects a pre-verification token in afterConnectionEstablished.
Java-WebSocket's connectBlocking() releases its latch on both open and close
and then returns engine.isOpen(), so it returns false when the client reads
the close frame before the caller checks the state. The asserted connect in
buildAndConnectWebSocketClient then failed.
The test now connects without asserting the connect result, waits for the
close, and asserts the server close code (1011), so it still proves the
token was rejected.
The rule engine stats report runs on a schedule. On its first report for
a tenant it creates a QUEUE_STATS entity, whose SaveEntityEvent becomes
an ADDED sendNotificationMsgToEdge call. When that tick fell between
Mockito.reset and verify, testFindTenantAssets and
testFindAssetTypesByTenantId saw one extra invocation (179 vs 178, 4 vs 3).
Count only entity ids that have an edge event type, which is the same
filter DefaultTbClusterService applies before sending to an edge.
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.
The tests run ZkDiscoveryService against an embedded ZooKeeper server
and check that the current node is registered once with a protected
node name and is excluded from other servers, both after start and
after a session expiry.
The delayed recalculation task is scheduled and stored in delayed tasks atomically, so a task started with zero delay always finds itself in delayed tasks and does not skip the recalculation.
The current node ZK node is created with Curator protection, so a create
retried after a connection loss reuses the node already created by the
lost attempt, and a node left by a failed create is deleted in the
background instead of staying registered for the lifetime of the session.
Other servers list excludes ZK nodes carrying the current service id and
keeps a single, most recently modified, ZK node per service id, so every
node builds the same partition ring when a service has duplicate
registrations.
Cache events for ZK nodes with the current service id are ignored, with
an error logged when such a node appears. Removal of a duplicate ZK node
of another service no longer publishes a shutdown event while that
service is still registered.