Browse Source

Merge remote-tracking branch 'upstream/lts-4.2' into fix/send-email-uplink

pull/15940/head
Nikita Mazurenko 2 months ago
parent
commit
85e7ecb87c
  1. 4
      TEST_FAST.md
  2. 2
      application/pom.xml
  3. 59
      application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcService.java
  4. 221
      application/src/test/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcServiceTest.java
  5. 2
      common/actor/pom.xml
  6. 2
      common/cache/pom.xml
  7. 2
      common/cluster-api/pom.xml
  8. 2
      common/coap-server/pom.xml
  9. 2
      common/dao-api/pom.xml
  10. 2
      common/data/pom.xml
  11. 2
      common/discovery-api/pom.xml
  12. 2
      common/edge-api/pom.xml
  13. 1
      common/edge-api/src/main/proto/edge.proto
  14. 2
      common/edqs/pom.xml
  15. 2
      common/message/pom.xml
  16. 2
      common/pom.xml
  17. 2
      common/proto/pom.xml
  18. 2
      common/queue/pom.xml
  19. 2
      common/script/pom.xml
  20. 2
      common/script/remote-js-client/pom.xml
  21. 2
      common/script/script-api/pom.xml
  22. 2
      common/stats/pom.xml
  23. 2
      common/transport/coap/pom.xml
  24. 2
      common/transport/http/pom.xml
  25. 2
      common/transport/lwm2m/pom.xml
  26. 2
      common/transport/mqtt/pom.xml
  27. 2
      common/transport/pom.xml
  28. 2
      common/transport/snmp/pom.xml
  29. 2
      common/transport/transport-api/pom.xml
  30. 2
      common/util/pom.xml
  31. 2
      common/version-control/pom.xml
  32. 2
      dao/pom.xml
  33. 2
      edqs/pom.xml
  34. 2
      monitoring/pom.xml
  35. 2
      msa/black-box-tests/pom.xml
  36. 2
      msa/edqs/pom.xml
  37. 2
      msa/js-executor/package.json
  38. 23
      msa/js-executor/pom.xml
  39. 2
      msa/monitoring/pom.xml
  40. 38
      msa/pom.xml
  41. 2
      msa/tb-node/pom.xml
  42. 2
      msa/tb/pom.xml
  43. 2
      msa/transport/coap/pom.xml
  44. 2
      msa/transport/http/pom.xml
  45. 2
      msa/transport/lwm2m/pom.xml
  46. 2
      msa/transport/mqtt/pom.xml
  47. 2
      msa/transport/pom.xml
  48. 2
      msa/transport/snmp/pom.xml
  49. 2
      msa/vc-executor-docker/pom.xml
  50. 2
      msa/vc-executor/pom.xml
  51. 2
      msa/web-ui/package.json
  52. 5
      msa/web-ui/pom.xml
  53. 4
      netty-mqtt/pom.xml
  54. 135
      pom.xml
  55. 2
      rest-client/pom.xml
  56. 2
      rule-engine/pom.xml
  57. 2
      rule-engine/rule-engine-api/pom.xml
  58. 2
      rule-engine/rule-engine-components/pom.xml
  59. 2
      tools/pom.xml
  60. 2
      transport/coap/pom.xml
  61. 2
      transport/http/pom.xml
  62. 2
      transport/lwm2m/pom.xml
  63. 2
      transport/mqtt/pom.xml
  64. 2
      transport/pom.xml
  65. 2
      transport/snmp/pom.xml
  66. 2
      ui-ngx/package.json
  67. 13
      ui-ngx/pom.xml
  68. 9
      ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts
  69. 12
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts
  70. 40
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-markdown.component.scss
  71. 3
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.html
  72. 15
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts

4
TEST_FAST.md

@ -42,10 +42,12 @@ Use `-Dpkg.skip=true` to skip all packaging at once (equivalent to all four flag
|----------------------------|-------------------------------------------|--------------------------------------------------------------| |----------------------------|-------------------------------------------|--------------------------------------------------------------|
| `-Dpkg.skip=true` | All of the below (bootjar + deb + rpm + zip) | Yes | | `-Dpkg.skip=true` | All of the below (bootjar + deb + rpm + zip) | Yes |
| `-Dpkg.skip.bootjar=true` | `spring-boot:repackage` (`*-boot.jar`) | Yes — tests use the regular `.jar`, not the fat boot jar | | `-Dpkg.skip.bootjar=true` | `spring-boot:repackage` (`*-boot.jar`) | Yes — tests use the regular `.jar`, not the fat boot jar |
| `-Dpkg.skip.deb=true` | Gradle `buildDeb` + Maven `attach-artifact` | Yes — MSA docker modules copy the DEB from `target/` directly | | `-Dpkg.skip.deb=true` | Gradle `buildDeb` | Yes — MSA docker modules copy the DEB from `target/` directly |
| `-Dpkg.skip.rpm=true` | Gradle `buildRpm` | Yes — no test depends on the RPM | | `-Dpkg.skip.rpm=true` | Gradle `buildRpm` | Yes — no test depends on the RPM |
| `-Dpkg.skip.zip=true` | `maven-assembly-plugin` Windows ZIP | Yes — no test depends on the ZIP | | `-Dpkg.skip.zip=true` | `maven-assembly-plugin` Windows ZIP | Yes — no test depends on the ZIP |
`-Dskip.yarn=true` and `-Dskip.ui.build=true` imply `-Dpkg.skip=true`: packages built without the UI are incomplete.
## Testcontainers compatibility with the Docker API workaround ## Testcontainers compatibility with the Docker API workaround
In case your tests failed to run testcontainers due to unsupported Docker API version In case your tests failed to run testcontainers due to unsupported Docker API version

2
application/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>application</artifactId> <artifactId>application</artifactId>

59
application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcService.java

@ -24,6 +24,7 @@ import org.thingsboard.common.util.ThingsBoardExecutors;
import org.thingsboard.rule.engine.api.AttributesSaveRequest; import org.thingsboard.rule.engine.api.AttributesSaveRequest;
import org.thingsboard.rule.engine.api.TimeseriesSaveRequest; import org.thingsboard.rule.engine.api.TimeseriesSaveRequest;
import org.thingsboard.server.cache.TbTransactionalCache; import org.thingsboard.server.cache.TbTransactionalCache;
import org.thingsboard.server.cache.TbCacheValueWrapper;
import org.thingsboard.server.cluster.TbClusterService; import org.thingsboard.server.cluster.TbClusterService;
import org.thingsboard.server.common.data.AttributeScope; import org.thingsboard.server.common.data.AttributeScope;
import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.DataConstants;
@ -45,11 +46,13 @@ import org.thingsboard.server.common.msg.edge.EdgeHighPriorityMsg;
import org.thingsboard.server.common.msg.edge.EdgeSessionMsg; import org.thingsboard.server.common.msg.edge.EdgeSessionMsg;
import org.thingsboard.server.common.msg.edge.FromEdgeSyncResponse; import org.thingsboard.server.common.msg.edge.FromEdgeSyncResponse;
import org.thingsboard.server.common.msg.edge.ToEdgeSyncRequest; import org.thingsboard.server.common.msg.edge.ToEdgeSyncRequest;
import org.thingsboard.server.common.msg.queue.ServiceType;
import org.thingsboard.server.gen.edge.v1.EdgeRpcServiceGrpc; import org.thingsboard.server.gen.edge.v1.EdgeRpcServiceGrpc;
import org.thingsboard.server.gen.edge.v1.RequestMsg; import org.thingsboard.server.gen.edge.v1.RequestMsg;
import org.thingsboard.server.gen.edge.v1.ResponseMsg; import org.thingsboard.server.gen.edge.v1.ResponseMsg;
import org.thingsboard.server.queue.discovery.TbServiceInfoProvider; import org.thingsboard.server.queue.discovery.TbServiceInfoProvider;
import org.thingsboard.server.queue.discovery.TopicService; import org.thingsboard.server.queue.discovery.TopicService;
import org.thingsboard.server.queue.discovery.PartitionService;
import org.thingsboard.server.queue.kafka.KafkaAdmin; import org.thingsboard.server.queue.kafka.KafkaAdmin;
import org.thingsboard.server.queue.provider.TbCoreQueueFactory; import org.thingsboard.server.queue.provider.TbCoreQueueFactory;
import org.thingsboard.server.queue.util.AfterStartUp; import org.thingsboard.server.queue.util.AfterStartUp;
@ -139,6 +142,9 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
@Autowired @Autowired
private TbTransactionalCache<EdgeId, String> edgeIdServiceIdCache; private TbTransactionalCache<EdgeId, String> edgeIdServiceIdCache;
@Autowired
private PartitionService partitionService;
@Autowired @Autowired
private TopicService topicService; private TopicService topicService;
@ -369,10 +375,13 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
} finally { } finally {
newEventLock.unlock(); newEventLock.unlock();
} }
// Claim ownership before writing the active state, not after: onEdgeDisconnect on the node this edge
// just left reads the cache to decide whether to clear the flag, so publishing the claim first keeps
// it from seeing a stale owner and clearing a state we have already set.
edgeIdServiceIdCache.put(edgeId, serviceInfoProvider.getServiceId());
save(tenantId, edgeId, ACTIVITY_STATE, true); save(tenantId, edgeId, ACTIVITY_STATE, true);
long lastConnectTs = System.currentTimeMillis(); long lastConnectTs = System.currentTimeMillis();
save(tenantId, edgeId, LAST_CONNECT_TIME, lastConnectTs); save(tenantId, edgeId, LAST_CONNECT_TIME, lastConnectTs);
edgeIdServiceIdCache.put(edgeId, serviceInfoProvider.getServiceId());
pushRuleEngineMessage(tenantId, edge, lastConnectTs, TbMsgType.CONNECT_EVENT); pushRuleEngineMessage(tenantId, edge, lastConnectTs, TbMsgType.CONNECT_EVENT);
cancelScheduleEdgeEventsCheck(edgeId); cancelScheduleEdgeEventsCheck(edgeId);
edgeEventsMigrationProcessed.putIfAbsent(edgeId, Boolean.FALSE); edgeEventsMigrationProcessed.putIfAbsent(edgeId, Boolean.FALSE);
@ -520,8 +529,12 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
EdgeId edgeId = edge.getId(); EdgeId edgeId = edge.getId();
log.info("[{}][{}] edge disconnected!", edgeId, sessionId); log.info("[{}][{}] edge disconnected!", edgeId, sessionId);
EdgeGrpcSession current = sessions.get(edgeId); EdgeGrpcSession current = sessions.get(edgeId);
if (current != null && current.getSessionId().equals(sessionId)) { // Claim-once removal: get() and remove() are not atomic, so a session that was replaced between the
EdgeGrpcSession toRemove = sessions.remove(edgeId); // two would otherwise be dropped from the map, torn down and marked inactive by this stale callback
// even though it is the live one. Losing the race means this callback owns nothing - fall through to
// the stale-session branch below.
if (current != null && current.getSessionId().equals(sessionId) && sessions.remove(edgeId, current)) {
EdgeGrpcSession toRemove = current;
final Lock newEventLock = sessionNewEventsLocks.computeIfAbsent(edgeId, id -> new ReentrantLock()); final Lock newEventLock = sessionNewEventsLocks.computeIfAbsent(edgeId, id -> new ReentrantLock());
newEventLock.lock(); newEventLock.lock();
try { try {
@ -532,7 +545,13 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
destroySession(toRemove); destroySession(toRemove);
sessionsById.remove(sessionId); sessionsById.remove(sessionId);
TenantId tenantId = toRemove.getEdge().getTenantId(); TenantId tenantId = toRemove.getEdge().getTenantId();
save(tenantId, edgeId, ACTIVITY_STATE, false); // A newer session on another node may have already claimed this edge and set active=true.
// Clearing the flag here would leave the edge marked inactive while it is in fact connected,
// which silently drops every downlink event that is not queued for offline edges.
// When ownership is unknown (no cache entry) fall through and persist the inactive state.
if (!isOwnedByAnotherNode(edgeId)) {
save(tenantId, edgeId, ACTIVITY_STATE, false);
}
long lastDisconnectTs = System.currentTimeMillis(); long lastDisconnectTs = System.currentTimeMillis();
save(tenantId, edgeId, LAST_DISCONNECT_TIME, lastDisconnectTs); save(tenantId, edgeId, LAST_DISCONNECT_TIME, lastDisconnectTs);
pushRuleEngineMessage(toRemove.getEdge().getTenantId(), edge, lastDisconnectTs, TbMsgType.DISCONNECT_EVENT); pushRuleEngineMessage(toRemove.getEdge().getTenantId(), edge, lastDisconnectTs, TbMsgType.DISCONNECT_EVENT);
@ -551,7 +570,37 @@ public class EdgeGrpcService extends EdgeRpcServiceGrpc.EdgeRpcServiceImplBase i
log.debug("[{}] No session found by sessionId [{}] to destroy", edgeId, sessionId); log.debug("[{}] No session found by sessionId [{}] to destroy", edgeId, sessionId);
} }
} }
edgeIdServiceIdCache.evict(edgeId); // Only evict if the cache still points at this node. If the edge already reconnected to another
// TB-Core node, that node has overwritten the entry and owns it - evicting here would wipe the live
// owner's claim and defeat the activity-state guard above.
if (isOwnedByThisNode(edgeId)) {
edgeIdServiceIdCache.evict(edgeId);
}
}
// The edge's service-id cache entry points at a different node that is still a live TB-Core service.
// Two cases deliberately do NOT count as "owned by another node", so that the caller falls through and
// persists the inactive state:
// - no cache entry: ownership is unknown, not claimed by someone else;
// - entry naming a node that is no longer in the cluster: the edge sessions cache has no TTL by default
// (CACHE_SPECS_EDGE_SESSIONS_TTL=0) and is only ever evicted by the owning node, so a node that died
// without evicting would otherwise keep the edge marked active forever, with no reconciler to correct it.
private boolean isOwnedByAnotherNode(EdgeId edgeId) {
TbCacheValueWrapper<String> wrapper = edgeIdServiceIdCache.get(edgeId);
if (wrapper == null) {
return false;
}
String ownerServiceId = wrapper.get();
if (ownerServiceId == null || serviceInfoProvider.getServiceId().equals(ownerServiceId)) {
return false;
}
return partitionService.getAllServiceIds(ServiceType.TB_CORE).contains(ownerServiceId);
}
// The edge's service-id cache entry still points at this node, i.e. this node is the recorded owner.
private boolean isOwnedByThisNode(EdgeId edgeId) {
TbCacheValueWrapper<String> wrapper = edgeIdServiceIdCache.get(edgeId);
return wrapper != null && serviceInfoProvider.getServiceId().equals(wrapper.get());
} }
private void destroySession(EdgeGrpcSession session) { private void destroySession(EdgeGrpcSession session) {

221
application/src/test/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcServiceTest.java

@ -0,0 +1,221 @@
/**
* Copyright © 2016-2026 The Thingsboard Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.thingsboard.server.service.edge.rpc;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentMatcher;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.test.util.ReflectionTestUtils;
import org.thingsboard.rule.engine.api.AttributesSaveRequest;
import org.thingsboard.server.cache.SimpleTbCacheValueWrapper;
import org.thingsboard.server.cache.TbTransactionalCache;
import org.thingsboard.server.cluster.TbClusterService;
import org.thingsboard.server.common.data.edge.Edge;
import org.thingsboard.server.common.data.id.EdgeId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.msg.queue.ServiceType;
import org.thingsboard.server.queue.discovery.PartitionService;
import org.thingsboard.server.queue.discovery.TbServiceInfoProvider;
import org.thingsboard.server.service.edge.EdgeContextComponent;
import org.thingsboard.server.service.telemetry.TelemetrySubscriptionService;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.thingsboard.server.service.state.DefaultDeviceStateService.ACTIVITY_STATE;
@ExtendWith(MockitoExtension.class)
public class EdgeGrpcServiceTest {
private static final String THIS_NODE = "tb-core-1";
private static final String OTHER_NODE = "tb-core-2";
@Mock
private TbTransactionalCache<EdgeId, String> edgeIdServiceIdCache;
@Mock
private TbServiceInfoProvider serviceInfoProvider;
@Mock
private PartitionService partitionService;
@Mock
private TelemetrySubscriptionService tsSubService;
@Mock
private TbClusterService clusterService;
@Mock
private EdgeContextComponent ctx;
@InjectMocks
private EdgeGrpcService edgeGrpcService;
private EdgeId edgeId;
private Edge edge;
@BeforeEach
public void setUp() {
edgeId = new EdgeId(UUID.randomUUID());
edge = new Edge(edgeId);
edge.setTenantId(TenantId.fromUUID(UUID.randomUUID()));
edge.setName("test-edge");
}
// --- activity-state write guard on disconnect ---
@Test
public void givenEdgeReconnectedToAnotherNode_whenDisconnect_thenInactiveStateNotPersisted() {
// A newer session on another node already set active=true. This stale session's disconnect must not
// clobber it - otherwise the edge stays marked inactive while connected, and the server silently
// drops every assignment event for it.
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(OTHER_NODE));
when(partitionService.getAllServiceIds(ServiceType.TB_CORE)).thenReturn(Set.of(THIS_NODE, OTHER_NODE));
onEdgeDisconnect(sessionId);
verify(tsSubService, never()).saveAttributes(argThat(inactiveStateWrite()));
}
@Test
public void givenEdgeOwnedByThisNode_whenDisconnect_thenInactiveStateIsPersisted() {
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(THIS_NODE));
onEdgeDisconnect(sessionId);
verify(tsSubService, times(1)).saveAttributes(argThat(inactiveStateWrite()));
}
@Test
public void givenNoCacheEntry_whenDisconnect_thenInactiveStateIsPersisted() {
// Ownership unknown (entry absent or expired): keep the pre-guard behaviour, otherwise a genuinely
// disconnected edge would stay marked active forever.
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(null);
onEdgeDisconnect(sessionId);
verify(tsSubService, times(1)).saveAttributes(argThat(inactiveStateWrite()));
}
@Test
public void givenOwnerNodeNoLongerInCluster_whenDisconnect_thenInactiveStateIsPersisted() {
// The recorded owner died without evicting its claim. The edge sessions cache has no TTL by default
// and only the owner ever evicts, so honouring a dead claim would leave the edge active forever.
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(OTHER_NODE));
when(partitionService.getAllServiceIds(ServiceType.TB_CORE)).thenReturn(Set.of(THIS_NODE));
onEdgeDisconnect(sessionId);
verify(tsSubService, times(1)).saveAttributes(argThat(inactiveStateWrite()));
}
@Test
public void givenSessionReplacedDuringDisconnect_whenStaleCallbackRuns_thenLiveSessionKept() {
// Reproduces the get()/remove() interleaving on a single node: onEdgeConnect swaps in a new session
// right after the stale callback's id check passes. The stale callback must not evict or tear down
// the live session, nor clear the activity state.
UUID staleSessionId = UUID.randomUUID();
EdgeGrpcSession live = mock(EdgeGrpcSession.class);
EdgeGrpcSession stale = mock(EdgeGrpcSession.class);
when(stale.getSessionId()).thenAnswer(invocation -> {
sessions().put(edgeId, live);
return staleSessionId;
});
sessions().put(edgeId, stale);
onEdgeDisconnect(staleSessionId);
assertThat(sessions().get(edgeId)).isSameAs(live);
verify(tsSubService, never()).saveAttributes(argThat(inactiveStateWrite()));
}
// --- service-id cache eviction guard ---
@Test
public void givenCacheOwnedByThisNode_whenDisconnect_thenEntryIsEvicted() {
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(THIS_NODE));
onEdgeDisconnect(sessionId);
verify(edgeIdServiceIdCache, times(1)).evict(edgeId);
}
@Test
public void givenCacheOwnedByAnotherNode_whenDisconnect_thenEntryIsKept() {
// The edge already reconnected elsewhere: wiping the live owner's claim would defeat the
// activity-state guard for any later disconnect callback.
UUID sessionId = UUID.randomUUID();
sessions().put(edgeId, sessionFor(sessionId));
when(serviceInfoProvider.getServiceId()).thenReturn(THIS_NODE);
when(edgeIdServiceIdCache.get(edgeId)).thenReturn(SimpleTbCacheValueWrapper.wrap(OTHER_NODE));
when(partitionService.getAllServiceIds(ServiceType.TB_CORE)).thenReturn(Set.of(THIS_NODE, OTHER_NODE));
onEdgeDisconnect(sessionId);
verify(edgeIdServiceIdCache, never()).evict(edgeId);
}
private void onEdgeDisconnect(UUID sessionId) {
ReflectionTestUtils.invokeMethod(edgeGrpcService, "onEdgeDisconnect", edge, sessionId);
}
private EdgeGrpcSession sessionFor(UUID sessionId) {
EdgeGrpcSession session = mock(EdgeGrpcSession.class);
when(session.getSessionId()).thenReturn(sessionId);
when(session.getEdge()).thenReturn(edge);
return session;
}
@SuppressWarnings("unchecked")
private ConcurrentMap<EdgeId, EdgeGrpcSession> sessions() {
return (ConcurrentMap<EdgeId, EdgeGrpcSession>) ReflectionTestUtils.getField(edgeGrpcService, "sessions");
}
private ArgumentMatcher<AttributesSaveRequest> inactiveStateWrite() {
return request -> request != null
&& edgeId.equals(request.getEntityId())
&& request.getEntries().stream().anyMatch(entry ->
ACTIVITY_STATE.equals(entry.getKey())
&& Boolean.FALSE.equals(entry.getBooleanValue().orElse(null)));
}
}

2
common/actor/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/cache/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/cluster-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/coap-server/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/dao-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/data/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/discovery-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/edge-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

1
common/edge-api/src/main/proto/edge.proto

@ -38,6 +38,7 @@ enum EdgeVersion {
V_4_2_2_3 = 4223; V_4_2_2_3 = 4223;
V_4_2_2_4 = 4224; V_4_2_2_4 = 4224;
V_4_2_2_5 = 4225; V_4_2_2_5 = 4225;
V_4_2_2_6 = 4226;
V_LATEST = 99999; V_LATEST = 99999;
} }

2
common/edqs/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/message/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>common</artifactId> <artifactId>common</artifactId>

2
common/proto/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/queue/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/script/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/script/remote-js-client/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>script</artifactId> <artifactId>script</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common.script</groupId> <groupId>org.thingsboard.common.script</groupId>

2
common/script/script-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>script</artifactId> <artifactId>script</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common.script</groupId> <groupId>org.thingsboard.common.script</groupId>

2
common/stats/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/transport/coap/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common.transport</groupId> <groupId>org.thingsboard.common.transport</groupId>

2
common/transport/http/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common.transport</groupId> <groupId>org.thingsboard.common.transport</groupId>

2
common/transport/lwm2m/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common.transport</groupId> <groupId>org.thingsboard.common.transport</groupId>

2
common/transport/mqtt/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common.transport</groupId> <groupId>org.thingsboard.common.transport</groupId>

2
common/transport/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/transport/snmp/pom.xml

@ -10,7 +10,7 @@
<parent> <parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>

2
common/transport/transport-api/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common.transport</groupId> <groupId>org.thingsboard.common.transport</groupId>

2
common/util/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
common/version-control/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>common</artifactId> <artifactId>common</artifactId>
</parent> </parent>
<groupId>org.thingsboard.common</groupId> <groupId>org.thingsboard.common</groupId>

2
dao/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>dao</artifactId> <artifactId>dao</artifactId>

2
edqs/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>edqs</artifactId> <artifactId>edqs</artifactId>

2
monitoring/pom.xml

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>

2
msa/black-box-tests/pom.xml

@ -10,7 +10,7 @@
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>

2
msa/edqs/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>

2
msa/js-executor/package.json

@ -1,7 +1,7 @@
{ {
"name": "thingsboard-js-executor", "name": "thingsboard-js-executor",
"private": true, "private": true,
"version": "4.2.2.5", "version": "4.2.2.6",
"description": "ThingsBoard JavaScript Executor Microservice", "description": "ThingsBoard JavaScript Executor Microservice",
"main": "server.ts", "main": "server.ts",
"bin": "server.js", "bin": "server.js",

23
msa/js-executor/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>
@ -30,6 +30,13 @@
<pkg.package.phase>package</pkg.package.phase> <pkg.package.phase>package</pkg.package.phase>
<pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist> <pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist>
<pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist> <pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist>
<!-- The `yarn test` execution has to be skipped when tests are skipped and also when the
yarn build as a whole is skipped: with `yarn install` skipped there is no node_modules
to run the tests from. Maven has no boolean OR, so skip.yarn is used as the default
here (honoured both from the command line and from a pom property) and the
skip-yarn-test profile below folds in maven.test.skip, which is only ever passed on
the command line. -->
<yarn.test.skip>${skip.yarn}</yarn.test.skip>
<docker.push-arm-amd-image.phase>pre-integration-test</docker.push-arm-amd-image.phase> <docker.push-arm-amd-image.phase>pre-integration-test</docker.push-arm-amd-image.phase>
</properties> </properties>
@ -112,7 +119,7 @@
</goals> </goals>
<phase>test</phase> <phase>test</phase>
<configuration> <configuration>
<skip>${maven.test.skip}</skip> <skip>${yarn.test.skip}</skip>
<arguments>--mutex network run test</arguments> <arguments>--mutex network run test</arguments>
</configuration> </configuration>
</execution> </execution>
@ -206,6 +213,18 @@
</plugins> </plugins>
</build> </build>
<profiles> <profiles>
<profile>
<id>skip-yarn-test</id>
<activation>
<property>
<name>maven.test.skip</name>
<value>true</value>
</property>
</activation>
<properties>
<yarn.test.skip>true</yarn.test.skip>
</properties>
</profile>
<profile> <profile>
<id>yarn-start</id> <id>yarn-start</id>
<activation> <activation>

2
msa/monitoring/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>

38
msa/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
@ -55,10 +55,7 @@
</modules> </modules>
<profiles> <profiles>
<!-- Mirror of the root-pom skip-deb profile. Required because Maven resolves <!-- Activated by -Dpkg.skip.deb=true. Skips the .deb enforce/copy executions. -->
child <properties> entries (pkg.deb.phase=package above) with higher priority
than profile properties from a parent POM. Redeclaring the profile here ensures
pkg.deb.phase=none wins when -Dpkg.skip.deb=true is passed. -->
<profile> <profile>
<id>skip-deb</id> <id>skip-deb</id>
<activation> <activation>
@ -71,9 +68,9 @@
<pkg.deb.phase>none</pkg.deb.phase> <pkg.deb.phase>none</pkg.deb.phase>
</properties> </properties>
</profile> </profile>
<!-- Mirror of the root-pom skip-pkg profile. Same precedence reason as skip-deb above: <!-- Activated by -Dpkg.skip=true. Needed alongside skip-deb because profile activation
pkg.deb.phase=package in this POM's <properties> would win over the parent profile, only sees CLI/system properties, so pkg.skip.deb=true set by the root skip-pkg
so we must redeclare it here to ensure pkg.deb.phase=none when -Dpkg.skip=true. --> profile does not activate skip-deb. -->
<profile> <profile>
<id>skip-pkg</id> <id>skip-pkg</id>
<activation> <activation>
@ -86,6 +83,31 @@
<pkg.deb.phase>none</pkg.deb.phase> <pkg.deb.phase>none</pkg.deb.phase>
</properties> </properties>
</profile> </profile>
<!-- Mirror the root skip-pkg-without-* profiles: no .deb is built when the UI build is skipped. -->
<profile>
<id>skip-pkg-without-yarn</id>
<activation>
<property>
<name>skip.yarn</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<profile>
<id>skip-pkg-without-ui-build</id>
<activation>
<property>
<name>skip.ui.build</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<profile> <profile>
<id>black-box-tests</id> <id>black-box-tests</id>
<activation> <activation>

2
msa/tb-node/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>

2
msa/tb/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>

2
msa/transport/coap/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa.transport</groupId> <groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/http/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa.transport</groupId> <groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/lwm2m/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa.transport</groupId> <groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/mqtt/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa.transport</groupId> <groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>

2
msa/transport/snmp/pom.xml

@ -10,7 +10,7 @@
<parent> <parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
</parent> </parent>
<groupId>org.thingsboard.msa.transport</groupId> <groupId>org.thingsboard.msa.transport</groupId>

2
msa/vc-executor-docker/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>

2
msa/vc-executor/pom.xml

@ -10,7 +10,7 @@
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>

2
msa/web-ui/package.json

@ -1,7 +1,7 @@
{ {
"name": "thingsboard-web-ui", "name": "thingsboard-web-ui",
"private": true, "private": true,
"version": "4.2.2.5", "version": "4.2.2.6",
"description": "ThingsBoard Web UI Microservice", "description": "ThingsBoard Web UI Microservice",
"main": "server.ts", "main": "server.ts",
"bin": "server.js", "bin": "server.js",

5
msa/web-ui/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>msa</artifactId> <artifactId>msa</artifactId>
</parent> </parent>
<groupId>org.thingsboard.msa</groupId> <groupId>org.thingsboard.msa</groupId>
@ -60,6 +60,9 @@
<configuration> <configuration>
<installDirectory>target</installDirectory> <installDirectory>target</installDirectory>
<workingDirectory>${basedir}</workingDirectory> <workingDirectory>${basedir}</workingDirectory>
<!-- Declared at plugin level so that it covers every execution of this plugin,
including the ones contributed by the profiles below. -->
<skip>${skip.ui.build}</skip>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>

4
netty-mqtt/pom.xml

@ -8,11 +8,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>netty-mqtt</artifactId> <artifactId>netty-mqtt</artifactId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Netty MQTT Client</name> <name>Netty MQTT Client</name>

135
pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Thingsboard</name> <name>Thingsboard</name>
@ -28,20 +28,27 @@
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<main.dir>${basedir}</main.dir> <main.dir>${basedir}</main.dir>
<!-- Set to true to skip only the UI builds: the Angular application in ui-ngx and the
`yarn run pkg` launcher of msa/web-ui. It deliberately does NOT
cover msa/js-executor, whose yarn install and sandbox tests keep running.
frontend-maven-plugin reads skip.yarn itself, so that property cannot be narrowed to a
subset of the modules; this one can, and it defaults to skip.yarn so that
-Dskip.yarn=true still skips every yarn invocation in the project exactly as before.
Either flag also skips all packaging (see the skip-pkg-without-* profiles). -->
<skip.ui.build>${skip.yarn}</skip.ui.build>
<pkg.process-resources.phase>none</pkg.process-resources.phase> <pkg.process-resources.phase>none</pkg.process-resources.phase>
<pkg.package.phase>none</pkg.package.phase> <pkg.package.phase>none</pkg.package.phase>
<!-- Use -Dpkg.skip=true to skip all packaging at once (bootjar + deb + rpm + zip). <!-- Use -Dpkg.skip=true to skip all packaging at once (bootjar + deb + rpm + zip).
Individual flags below can be set independently for finer control. --> Individual flags below can be set independently for finer control. -->
<!-- Set to true to skip spring-boot:repackage (the boot jar, i.e. the *-boot.jar artifact). <!-- Set to true to skip spring-boot:repackage (the boot jar, i.e. the *-boot.jar artifact).
The boot jar is the mandatory input to Gradle buildDeb; skipping it also prevents The boot jar is the mandatory input to Gradle buildDeb; skipping it also prevents
the .deb from being produced. Any msa/* module that depends on a .deb artifact the .deb from being produced. Any msa/* module that copies a .deb
(e.g. msa/tb-node depends on application:deb) will FAIL when the boot jar and (e.g. msa/tb-node copies application's .deb) will FAIL when the boot jar and
consequently the .deb are missing. Each packaging module overrides this to false. --> consequently the .deb are missing. Each packaging module overrides this to false. -->
<pkg.skip.bootjar>false</pkg.skip.bootjar> <pkg.skip.bootjar>false</pkg.skip.bootjar>
<!-- Set to true to skip Gradle buildDeb and suppress the Maven attach-artifact goal <!-- Set to true to skip Gradle buildDeb. msa/* docker modules copy the .deb directly
that registers the .deb with the reactor. msa/* docker modules copy the .deb from the upstream module's target/ directory, and their copy execution is bound to
directly from the upstream module's target/ directory (not from .m2), and their ${pkg.deb.phase} (see msa/pom.xml), so they are silently skipped too. -->
copy execution is bound to ${pkg.deb.phase}, so they are silently skipped too. -->
<pkg.skip.deb>false</pkg.skip.deb> <pkg.skip.deb>false</pkg.skip.deb>
<!-- Set to true to skip Gradle buildRpm. No Maven reactor module depends on the RPM <!-- Set to true to skip Gradle buildRpm. No Maven reactor module depends on the RPM
artifact, so this flag can be toggled freely without breaking downstream modules. --> artifact, so this flag can be toggled freely without breaking downstream modules. -->
@ -50,11 +57,6 @@
module depends on the ZIP artifact, so this flag can be toggled freely without module depends on the ZIP artifact, so this flag can be toggled freely without
breaking downstream modules. --> breaking downstream modules. -->
<pkg.skip.zip>false</pkg.skip.zip> <pkg.skip.zip>false</pkg.skip.zip>
<!-- Internal: resolved phase for the build-helper attach-deb execution. Overridden to
"none" by the skip-deb profile when pkg.skip.deb=true so the goal is silently
skipped instead of failing on a non-existent .deb file. Packaging modules inherit
"package" via pkg.package.phase; msa/* docker modules set it explicitly in msa/pom.xml. -->
<pkg.deb.phase>${pkg.package.phase}</pkg.deb.phase>
<pkg.user>thingsboard</pkg.user> <pkg.user>thingsboard</pkg.user>
<pkg.implementationTitle>${project.name}</pkg.implementationTitle> <pkg.implementationTitle>${project.name}</pkg.implementationTitle>
<pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder> <pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder>
@ -215,31 +217,46 @@
</properties> </properties>
</profile> </profile>
<!-- Activated by -Dpkg.skip.deb=true. Sets the attach-artifact lifecycle phase to "none" <!-- Activated by -Dpkg.skip=true. Convenience alias that sets all four skip flags at once. -->
so the build-helper goal that registers the .deb with the Maven reactor is silently
skipped. Without this, the goal would fail because the .deb file does not exist. -->
<profile> <profile>
<id>skip-deb</id> <id>skip-pkg</id>
<activation> <activation>
<property> <property>
<name>pkg.skip.deb</name> <name>pkg.skip</name>
<value>true</value> <value>true</value>
</property> </property>
</activation> </activation>
<properties> <properties>
<pkg.deb.phase>none</pkg.deb.phase> <pkg.skip.bootjar>true</pkg.skip.bootjar>
<pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip>
</properties> </properties>
</profile> </profile>
<!-- Activated by -Dpkg.skip=true. Convenience alias that sets all four skip flags at <!-- Packages built without the UI are incomplete (and the JS Windows ZIPs fail on the missing
once. Also sets pkg.deb.phase=none directly because Maven profile activation is launcher), so skipping the UI build skips all packaging too. One profile per flag because
evaluated against CLI/system properties only — a property set inside another profile activation only sees CLI/system properties, not the skip.ui.build default. -->
cannot trigger a second profile, so skip-deb would not fire automatically. -->
<profile> <profile>
<id>skip-pkg</id> <id>skip-pkg-without-yarn</id>
<activation> <activation>
<property> <property>
<name>pkg.skip</name> <name>skip.yarn</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.skip.bootjar>true</pkg.skip.bootjar>
<pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip>
</properties>
</profile>
<profile>
<id>skip-pkg-without-ui-build</id>
<activation>
<property>
<name>skip.ui.build</name>
<value>true</value> <value>true</value>
</property> </property>
</activation> </activation>
@ -248,7 +265,6 @@
<pkg.skip.deb>true</pkg.skip.deb> <pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm> <pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip> <pkg.skip.zip>true</pkg.skip.zip>
<pkg.deb.phase>none</pkg.deb.phase>
</properties> </properties>
</profile> </profile>
@ -538,21 +554,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/logback.xml</exclude>
</excludes>
<archive>
<manifestEntries>
<Implementation-Title>${pkg.implementationTitle}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
@ -565,6 +566,8 @@
<skip>${pkg.skip.bootjar}</skip> <skip>${pkg.skip.bootjar}</skip>
<mainClass>${pkg.mainClass}</mainClass> <mainClass>${pkg.mainClass}</mainClass>
<classifier>boot</classifier> <classifier>boot</classifier>
<!-- Input for Gradle packaging only; don't install/deploy the fat jar -->
<attach>false</attach>
<layout>ZIP</layout> <layout>ZIP</layout>
<executable>true</executable> <executable>true</executable>
<excludeDevtools>true</excludeDevtools> <excludeDevtools>true</excludeDevtools>
@ -579,7 +582,6 @@
<execution> <execution>
<goals> <goals>
<goal>repackage</goal> <goal>repackage</goal>
<goal>build-info</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
@ -641,28 +643,9 @@
</goals> </goals>
<configuration> <configuration>
<skipAssembly>${pkg.skip.zip}</skipAssembly> <skipAssembly>${pkg.skip.zip}</skipAssembly>
</configuration> <!-- Picked up from target/; don't install/deploy the Windows zip.
</execution> Set on the execution so other assemblies (e.g. rule nodes) stay attached. -->
</executions> <attach>false</attach>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-deb</id>
<phase>${pkg.deb.phase}</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/${pkg.name}.deb</file>
<type>deb</type>
<classifier>deb</classifier>
</artifact>
</artifacts>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
@ -718,6 +701,18 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>${jar-plugin.version}</version> <version>${jar-plugin.version}</version>
<!-- Outside the packaging profile: activating any other root profile (e.g. skip-pkg) disables it -->
<configuration>
<excludes>
<exclude>**/logback.xml</exclude>
</excludes>
<archive>
<manifestEntries>
<Implementation-Title>${pkg.implementationTitle}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
@ -728,6 +723,20 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version> <version>${spring-boot.version}</version>
<executions>
<!-- Outside the packaging profile: activating any other root profile (e.g. skip-pkg) disables it,
and ProjectInfo needs build-info.properties at runtime -->
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<!-- Overrides the packaging profile's pkg.skip.bootjar skip -->
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>

2
rest-client/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>rest-client</artifactId> <artifactId>rest-client</artifactId>

2
rule-engine/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>rule-engine</artifactId> <artifactId>rule-engine</artifactId>

2
rule-engine/rule-engine-api/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>rule-engine</artifactId> <artifactId>rule-engine</artifactId>
</parent> </parent>
<groupId>org.thingsboard.rule-engine</groupId> <groupId>org.thingsboard.rule-engine</groupId>

2
rule-engine/rule-engine-components/pom.xml

@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>rule-engine</artifactId> <artifactId>rule-engine</artifactId>
</parent> </parent>
<groupId>org.thingsboard.rule-engine</groupId> <groupId>org.thingsboard.rule-engine</groupId>

2
tools/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>tools</artifactId> <artifactId>tools</artifactId>

2
transport/coap/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.transport</groupId> <groupId>org.thingsboard.transport</groupId>

2
transport/http/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.transport</groupId> <groupId>org.thingsboard.transport</groupId>

2
transport/lwm2m/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.transport</groupId> <groupId>org.thingsboard.transport</groupId>

2
transport/mqtt/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>
<groupId>org.thingsboard.transport</groupId> <groupId>org.thingsboard.transport</groupId>

2
transport/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>

2
transport/snmp/pom.xml

@ -10,7 +10,7 @@
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>transport</artifactId> <artifactId>transport</artifactId>
</parent> </parent>

2
ui-ngx/package.json

@ -1,6 +1,6 @@
{ {
"name": "thingsboard", "name": "thingsboard",
"version": "4.2.2.5", "version": "4.2.2.6",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --configuration development --host 0.0.0.0 --open", "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --configuration development --host 0.0.0.0 --open",

13
ui-ngx/pom.xml

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
<version>4.2.2.5-SNAPSHOT</version> <version>4.2.2.6-SNAPSHOT</version>
<artifactId>thingsboard</artifactId> <artifactId>thingsboard</artifactId>
</parent> </parent>
<groupId>org.thingsboard</groupId> <groupId>org.thingsboard</groupId>
@ -37,6 +37,9 @@
<configuration> <configuration>
<installDirectory>target</installDirectory> <installDirectory>target</installDirectory>
<workingDirectory>${basedir}</workingDirectory> <workingDirectory>${basedir}</workingDirectory>
<!-- Declared at plugin level so that it covers every execution of this plugin,
including the ones contributed by the profiles below. -->
<skip>${skip.ui.build}</skip>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
@ -71,6 +74,14 @@
</filesets> </filesets>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<!-- Only consumed in-reactor by application and msa/web-ui -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
<profiles> <profiles>

9
ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts

@ -95,6 +95,12 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
wizardSteps: WizardStep[] = []; wizardSteps: WizardStep[] = [];
wizardStarted = false; wizardStarted = false;
reviewMode = false; reviewMode = false;
/**
* Set once the server has an installed item for this device. From that moment every way out of
* the wizard — including the header X and the Cancel button on a still-pending later step —
* has to report 'installed', or the caller keeps showing pre-install counts and badges.
*/
private installRegistered = false;
// Variable resolution state // Variable resolution state
formValues: Record<string, any> = {}; formValues: Record<string, any> = {};
@ -357,7 +363,7 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
} }
cancel(): void { cancel(): void {
this.dialogRef.close(false); this.dialogRef.close(this.installRegistered ? 'installed' : false);
} }
retryEntitySteps(step: WizardStep): void { retryEntitySteps(step: WizardStep): void {
@ -809,6 +815,7 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
{ ignoreLoading: true } { ignoreLoading: true }
) )
); );
this.installRegistered = true;
} catch (_e) { } catch (_e) {
// Non-critical — entities are created, tracking registration failed // Non-critical — entities are created, tracking registration failed
console.error('Failed to register device install', _e); console.error('Failed to register device install', _e);

12
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts

@ -51,6 +51,11 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy
@Input() mode: 'default' | 'add' = 'default'; @Input() mode: 'default' | 'add' = 'default';
@Input() fixedSubType: string; @Input() fixedSubType: string;
@Output() addItem = new EventEmitter<MpItemVersionView>(); @Output() addItem = new EventEmitter<MpItemVersionView>();
/**
* Fired whenever an install, update or delete changed what this tenant has installed, so a host
* page showing its own installed-items counter can refresh it instead of waiting for a reload.
*/
@Output() installedItemsChanged = new EventEmitter<void>();
@Input() set activeType(value: ItemType) { @Input() set activeType(value: ItemType) {
if (value && value !== this._activeType) { if (value && value !== this._activeType) {
const wasInit = !!this._activeType; const wasInit = !!this._activeType;
@ -627,7 +632,11 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy
}); });
} }
private reloadInstalledItems(): void { /**
* Re-reads what is installed for the active type and announces the change. Public so a host page
* that opens the item detail dialog itself can refresh this grid through the same path.
*/
reloadInstalledItems(): void {
const config = {ignoreLoading: true}; const config = {ignoreLoading: true};
const pageLink = new PageLink(10000, 0); const pageLink = new PageLink(10000, 0);
if (this.activeType === ItemType.WIDGET) { if (this.activeType === ItemType.WIDGET) {
@ -643,6 +652,7 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy
this.installedItemCounts = counts; this.installedItemCounts = counts;
}); });
} }
this.installedItemsChanged.emit();
} }
private loadFilterInfo(): void { private loadFilterInfo(): void {

40
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-markdown.component.scss

@ -3,6 +3,10 @@
$text-color: rgba(0,0,0,0.76); $text-color: rgba(0,0,0,0.76);
$link-color: #2a7dec; $link-color: #2a7dec;
$copy-button-color: #2a7dec; $copy-button-color: #2a7dec;
// Geometry of the copy icon chip, shared by the chip itself and by the space table
// cells reserve for it, so the two cannot drift apart.
$copy-icon-width: 38px;
$copy-icon-offset: 3px;
$code-block-border-color: rgba(42, 125, 236, .2); $code-block-border-color: rgba(42, 125, 236, .2);
$code-default-color: #212529; $code-default-color: #212529;
@ -169,10 +173,10 @@ $gallery-border-hover-color: #2a7dec;
div { div {
background-color: #fff; background-color: #fff;
position: absolute; position: absolute;
width: 38px; width: $copy-icon-width;
height: 28px; height: 28px;
top: 3px; top: $copy-icon-offset;
right: 3px; right: $copy-icon-offset;
padding: 8px 10px 0; padding: 8px 10px 0;
img { img {
@ -204,9 +208,30 @@ $gallery-border-hover-color: #2a7dec;
} }
th, td { th, td {
// Long unbreakable tokens (logins, e-mails, passwords) must never overflow their
// own column. `anywhere` also drops the cell min-content width down to a single
// character, so auto layout can always squeeze the table into the available
// width instead of overflowing (and getting clipped by `overflow: hidden`).
overflow-wrap: break-word; // fallback for engines without `anywhere`
overflow-wrap: anywhere;
// Text is not the only thing that can outgrow a column: a preformatted block keeps
// its whole line as min-content width, which auto layout cannot shrink, so the table
// would push past its container and get cut off by a host that hides horizontal
// overflow (iot-hub-item-detail-dialog's .dlg-body). Wrap it inside the cell instead.
// Prism sets `white-space: pre` on both the block and the code inside it, so both
// have to be relaxed for the cell to shrink.
pre, pre > code {
white-space: pre-wrap;
}
div.code-wrapper { div.code-wrapper {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
// Reserve room for the absolutely positioned copy icon, plus the same gap on its
// far side, so the cell text does not run underneath it and the reservation
// follows the chip if its geometry ever changes.
padding-right: $copy-icon-width + 2 * $copy-icon-offset;
button.clipboard-btn { button.clipboard-btn {
top: -6px; top: -6px;
@ -275,11 +300,10 @@ $gallery-border-hover-color: #2a7dec;
margin-top: 20px; margin-top: 20px;
margin-bottom: 20px; margin-bottom: 20px;
overflow: hidden; overflow: hidden;
table-layout: fixed; // Columns are sized to their content: with fixed layout every column got the
// same width, so cells with long values (e-mails, logins, tokens) had to wrap
&.auto { // mid-word while short columns kept a lot of unused space.
table-layout: auto; table-layout: auto;
}
> thead { > thead {
background-color: $table-header-background-color; background-color: $table-header-background-color;

3
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.html

@ -35,7 +35,8 @@
<!-- Browse component (without tabs) --> <!-- Browse component (without tabs) -->
<tb-iot-hub-browse <tb-iot-hub-browse
[activeType]="config.type" [activeType]="config.type"
[hideTabs]="true"> [hideTabs]="true"
(installedItemsChanged)="loadInstalledCount()">
</tb-iot-hub-browse> </tb-iot-hub-browse>
<!-- Become a Creator footer --> <!-- Become a Creator footer -->

15
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts

@ -1,12 +1,13 @@
// SPDX-FileCopyrightText: Copyright The Thingsboard Authors // SPDX-FileCopyrightText: Copyright The Thingsboard Authors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { ItemType } from '@shared/models/iot-hub/iot-hub-item.models'; import { ItemType } from '@shared/models/iot-hub/iot-hub-item.models';
import { IotHubApiService } from '@core/http/iot-hub-api.service'; import { IotHubApiService } from '@core/http/iot-hub-api.service';
import { IotHubActionsService } from '@home/components/iot-hub/iot-hub-actions.service'; import { IotHubActionsService } from '@home/components/iot-hub/iot-hub-actions.service';
import { TbIotHubBrowseComponent } from '@home/components/iot-hub/iot-hub-browse.component';
import { IotHubInstalledItem } from '@shared/models/iot-hub/iot-hub-installed-item.models'; import { IotHubInstalledItem } from '@shared/models/iot-hub/iot-hub-installed-item.models';
import { MpItemVersionView } from '@shared/models/iot-hub/iot-hub-version.models'; import { MpItemVersionView } from '@shared/models/iot-hub/iot-hub-version.models';
import { PageLink } from '@shared/models/page/page-link'; import { PageLink } from '@shared/models/page/page-link';
@ -83,6 +84,8 @@ export class TbIotHubItemsPageComponent implements OnInit {
config: ItemTypePageConfig; config: ItemTypePageConfig;
installedItemsCount = 0; installedItemsCount = 0;
@ViewChild(TbIotHubBrowseComponent) private browse: TbIotHubBrowseComponent;
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
@ -109,7 +112,7 @@ export class TbIotHubItemsPageComponent implements OnInit {
window.open(this.iotHubApiService.baseUrl + '/signup', '_blank'); window.open(this.iotHubApiService.baseUrl + '/signup', '_blank');
} }
private loadInstalledCount(): void { loadInstalledCount(): void {
this.iotHubApiService.getInstalledItemsCount(this.config.type, { ignoreLoading: true }).subscribe(count => { this.iotHubApiService.getInstalledItemsCount(this.config.type, { ignoreLoading: true }).subscribe(count => {
this.installedItemsCount = count; this.installedItemsCount = count;
}); });
@ -147,7 +150,13 @@ export class TbIotHubItemsPageComponent implements OnInit {
'default', 'default',
true, true,
openItem.preview openItem.preview
).subscribe(); ).subscribe(result => {
// The deep-linked dialog is opened by this page rather than by the grid, so its outcome
// has to be fed back in by hand — the grid then refreshes and announces the new count.
if (result === 'installed' || result === 'updated' || result === 'deleted') {
this.browse?.reloadInstalledItems();
}
});
}); });
} }

Loading…
Cancel
Save