Get full cipher details when update cipher notification is received (#3063)

This commit is contained in:
Robyn MacCallum 2022-07-11 11:03:44 -04:00 committed by GitHub
parent f6571346c2
commit c0bcdf4637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -262,6 +262,7 @@ export abstract class ApiService {
renewSendFileUploadUrl: (sendId: string, fileId: string) => Promise<SendFileUploadDataResponse>;
getCipher: (id: string) => Promise<CipherResponse>;
getFullCipherDetails: (id: string) => Promise<CipherResponse>;
getCipherAdmin: (id: string) => Promise<CipherResponse>;
getAttachmentData: (
cipherId: string,

View File

@ -589,6 +589,11 @@ export class ApiService implements ApiServiceAbstraction {
return new CipherResponse(r);
}
async getFullCipherDetails(id: string): Promise<CipherResponse> {
const r = await this.send("GET", "/ciphers/" + id + "/details", null, true, true);
return new CipherResponse(r);
}
async getCipherAdmin(id: string): Promise<CipherResponse> {
const r = await this.send("GET", "/ciphers/" + id + "/admin", null, true, true);
return new CipherResponse(r);

View File

@ -198,7 +198,7 @@ export class SyncService implements SyncServiceAbstraction {
}
if (shouldUpdate) {
const remoteCipher = await this.apiService.getCipher(notification.id);
const remoteCipher = await this.apiService.getFullCipherDetails(notification.id);
if (remoteCipher != null) {
await this.cipherService.upsert(new CipherData(remoteCipher));
this.messagingService.send("syncedUpsertedCipher", { cipherId: notification.id });