From 752e543c4170b52f6242c106baa008d5e291436c Mon Sep 17 00:00:00 2001 From: ViacheslavKlimov Date: Fri, 30 May 2025 11:25:42 +0300 Subject: [PATCH 1/3] Add JsonIgnore to TelemetrySubscriptionUpdate.getValues --- .../service/ws/telemetry/sub/TelemetrySubscriptionUpdate.java | 2 ++ .../src/test/java/org/thingsboard/server/msa/WsClient.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/src/main/java/org/thingsboard/server/service/ws/telemetry/sub/TelemetrySubscriptionUpdate.java b/application/src/main/java/org/thingsboard/server/service/ws/telemetry/sub/TelemetrySubscriptionUpdate.java index e24ab368ec..4959c5a348 100644 --- a/application/src/main/java/org/thingsboard/server/service/ws/telemetry/sub/TelemetrySubscriptionUpdate.java +++ b/application/src/main/java/org/thingsboard/server/service/ws/telemetry/sub/TelemetrySubscriptionUpdate.java @@ -15,6 +15,7 @@ */ package org.thingsboard.server.service.ws.telemetry.sub; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.With; @@ -73,6 +74,7 @@ public class TelemetrySubscriptionUpdate { this.errorMsg = errorMsg != null ? errorMsg : errorCode.getDefaultMsg(); } + @JsonIgnore public Map> getValues() { if (data == null || data.isEmpty()) { return Collections.emptyMap(); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/WsClient.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/WsClient.java index 748335cd06..25b935a2fe 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/WsClient.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/WsClient.java @@ -61,7 +61,7 @@ public class WsClient extends WebSocketClient { latch.countDown(); } } catch (IOException e) { - log.error("ws message can't be read"); + log.error("ws message can't be read", e); } } } From 8bb9dd7954996a38ef3ecfbae62153e6e40c8d8f Mon Sep 17 00:00:00 2001 From: ViacheslavKlimov Date: Fri, 30 May 2025 11:44:00 +0300 Subject: [PATCH 2/3] Fix EntityFields.getCustomerId --- .../common/data/edqs/fields/AbstractEntityFields.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AbstractEntityFields.java b/common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AbstractEntityFields.java index 4aad5eb4dd..cb1aa9300d 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AbstractEntityFields.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AbstractEntityFields.java @@ -17,7 +17,7 @@ package org.thingsboard.server.common.data.edqs.fields; import lombok.Data; import lombok.experimental.SuperBuilder; -import org.thingsboard.server.common.data.id.CustomerId; +import org.thingsboard.server.common.data.id.EntityId; import java.util.UUID; @@ -36,7 +36,7 @@ public class AbstractEntityFields implements EntityFields { this.id = id; this.createdTime = createdTime; this.tenantId = tenantId; - this.customerId = (customerId != null && customerId != CustomerId.NULL_UUID) ? customerId : null; + this.customerId = checkId(customerId); this.name = name; this.version = version; } @@ -62,4 +62,8 @@ public class AbstractEntityFields implements EntityFields { this(id, createdTime, tenantId, null, null, null); } + protected UUID checkId(UUID id) { + return id != null && !id.equals(EntityId.NULL_UUID) ? id : null; + } + } From 9b6bfd116a491084ed7d78eaf0d4e4e93f24f3da Mon Sep 17 00:00:00 2001 From: Sergey Matvienko Date: Fri, 23 May 2025 11:37:42 +0200 Subject: [PATCH 3/3] remove FILLFACTOR 95. As default 90 is fine for most applications --- .../resources/sql/schema-entities-idx-psql-addon.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dao/src/main/resources/sql/schema-entities-idx-psql-addon.sql b/dao/src/main/resources/sql/schema-entities-idx-psql-addon.sql index b756d282f8..ae70e8c725 100644 --- a/dao/src/main/resources/sql/schema-entities-idx-psql-addon.sql +++ b/dao/src/main/resources/sql/schema-entities-idx-psql-addon.sql @@ -22,19 +22,19 @@ -- That why we need to define DESC index explicitly as (ts DESC NULLS LAST) CREATE INDEX IF NOT EXISTS idx_rule_node_debug_event_main - ON rule_node_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95); + ON rule_node_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST); CREATE INDEX IF NOT EXISTS idx_rule_chain_debug_event_main - ON rule_chain_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95); + ON rule_chain_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST); CREATE INDEX IF NOT EXISTS idx_stats_event_main - ON stats_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95); + ON stats_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST); CREATE INDEX IF NOT EXISTS idx_lc_event_main - ON lc_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95); + ON lc_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST); CREATE INDEX IF NOT EXISTS idx_error_event_main - ON error_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95); + ON error_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST); CREATE INDEX IF NOT EXISTS idx_cf_debug_event_main - ON cf_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95); + ON cf_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST);