Commit 1f58c1b0d6e996cd9a37a5e521e575a5a3edaf41
1 parent
0546cb1e
Fix subscription service: ignore unmatched updates.
Showing
2 changed files
with
1 additions
and
2 deletions
@@ -46,7 +46,6 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr | @@ -46,7 +46,6 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr | ||
46 | private static final ConcurrentMap<String, String> externalSessionMap = new ConcurrentHashMap<>(); | 46 | private static final ConcurrentMap<String, String> externalSessionMap = new ConcurrentHashMap<>(); |
47 | 47 | ||
48 | @Autowired | 48 | @Autowired |
49 | - @Lazy | ||
50 | private TelemetryWebSocketService webSocketService; | 49 | private TelemetryWebSocketService webSocketService; |
51 | 50 | ||
52 | @Override | 51 | @Override |
@@ -432,7 +432,7 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio | @@ -432,7 +432,7 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio | ||
432 | deviceSubscriptions.stream().filter(filter).forEach(s -> { | 432 | deviceSubscriptions.stream().filter(filter).forEach(s -> { |
433 | String sessionId = s.getWsSessionId(); | 433 | String sessionId = s.getWsSessionId(); |
434 | List<TsKvEntry> subscriptionUpdate = f.apply(s); | 434 | List<TsKvEntry> subscriptionUpdate = f.apply(s); |
435 | - if (subscriptionUpdate == null || !subscriptionUpdate.isEmpty()) { | 435 | + if (subscriptionUpdate != null && !subscriptionUpdate.isEmpty()) { |
436 | SubscriptionUpdate update = new SubscriptionUpdate(s.getSubscriptionId(), subscriptionUpdate); | 436 | SubscriptionUpdate update = new SubscriptionUpdate(s.getSubscriptionId(), subscriptionUpdate); |
437 | if (s.isLocal()) { | 437 | if (s.isLocal()) { |
438 | updateSubscriptionState(sessionId, s, update); | 438 | updateSubscriptionState(sessionId, s, update); |