Fix invalid NotificationUpdate deserialization
This commit is contained in:
parent
9b72f88930
commit
74afb9c024
@ -130,7 +130,7 @@ public class DefaultNotificationCommandsHandler implements NotificationCommandsH
|
||||
private void handleNotificationUpdate(NotificationsSubscription subscription, NotificationUpdate update) {
|
||||
log.trace("[{}, subId: {}] Handling notification update: {}", subscription.getSessionId(), subscription.getSubscriptionId(), update);
|
||||
Notification notification = update.getNotification();
|
||||
UUID notificationId = update.getNotificationId();
|
||||
UUID notificationId = notification != null ? notification.getUuidId() : update.getNotificationId().getId();
|
||||
if (update.isCreated()) {
|
||||
subscription.getLatestUnreadNotifications().put(notificationId, notification);
|
||||
subscription.getTotalUnreadCounter().incrementAndGet();
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.thingsboard.server.service.ws.notification.sub;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@ -24,8 +23,6 @@ import org.thingsboard.server.common.data.id.NotificationId;
|
||||
import org.thingsboard.server.common.data.notification.Notification;
|
||||
import org.thingsboard.server.common.data.notification.NotificationStatus;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ -43,10 +40,4 @@ public class NotificationUpdate {
|
||||
|
||||
private boolean deleted;
|
||||
|
||||
@JsonIgnore
|
||||
public UUID getNotificationId() {
|
||||
return notificationId != null ? notificationId.getId() :
|
||||
notification != null ? notification.getUuidId() : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user