1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

message pack protocol for signalr

This commit is contained in:
Kyle Spearrin
2018-08-23 21:43:40 -04:00
parent 2dc77b6143
commit bc198c60d1
4 changed files with 54 additions and 32 deletions

View File

@@ -42,11 +42,11 @@ export class SyncCipherNotification {
revisionDate: Date;
constructor(response: any) {
this.id = response.Id;
this.userId = response.UserId;
this.organizationId = response.OrganizationId;
this.collectionIds = response.CollectionIds;
this.revisionDate = new Date(response.RevisionDate);
this.id = response.id || response.Id;
this.userId = response.userId || response.UserId;
this.organizationId = response.organizationId || response.OrganizationId;
this.collectionIds = response.collectionIds || response.CollectionIds;
this.revisionDate = new Date(response.revisionDate || response.RevisionDate);
}
}
@@ -56,9 +56,9 @@ export class SyncFolderNotification {
revisionDate: Date;
constructor(response: any) {
this.id = response.Id;
this.userId = response.UserId;
this.revisionDate = new Date(response.RevisionDate);
this.id = response.id || response.Id;
this.userId = response.userId || response.UserId;
this.revisionDate = new Date(response.revisionDate || response.RevisionDate);
}
}
@@ -67,7 +67,7 @@ export class SyncUserNotification {
date: Date;
constructor(response: any) {
this.userId = response.UserId;
this.date = new Date(response.Date);
this.userId = response.userId || response.UserId;
this.date = new Date(response.date || response.Date);
}
}

View File

@@ -1,4 +1,5 @@
import * as signalR from '@aspnet/signalr';
import * as signalRMsgPack from '@aspnet/signalr-protocol-msgpack';
import { NotificationType } from '../enums/notificationType';
@@ -54,7 +55,8 @@ export class NotificationsService implements NotificationsServiceAbstraction {
.withUrl(this.url + '/hub', {
accessTokenFactory: () => this.apiService.getActiveBearerToken(),
})
// .configureLogging(signalR.LogLevel.Information)
.withHubProtocol(new signalRMsgPack.MessagePackHubProtocol())
// .configureLogging(signalR.LogLevel.Trace)
.build();
this.signalrConnection.on('ReceiveMessage',