From d20f659bbcf361d82d4c54bdd7b84804a0cecc1b Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Wed, 25 Feb 2026 10:04:23 +0100 Subject: [PATCH] [PM-31406] fix: TypeScript 5.9 type compatibility fixes for vault-owned code (#19191) * fix: TypeScript 5.9 type compatibility fixes for vault-owned code Add explicit `as BufferSource` casts and `Uint8Array` wrapping to satisfy stricter type checking in TypeScript 5.9. Non-functional changes. * Fix cli build --- apps/cli/src/vault/create.command.ts | 2 +- libs/common/src/vault/abstractions/cipher.service.ts | 2 +- libs/common/src/vault/services/cipher.service.ts | 2 +- .../download-attachment/download-attachment.component.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/cli/src/vault/create.command.ts b/apps/cli/src/vault/create.command.ts index e1a91966afd..32f3b3aa547 100644 --- a/apps/cli/src/vault/create.command.ts +++ b/apps/cli/src/vault/create.command.ts @@ -170,7 +170,7 @@ export class CreateCommand { const updatedCipher = await this.cipherService.saveAttachmentRawWithServer( cipher, fileName, - new Uint8Array(fileBuf).buffer, + new Uint8Array(fileBuf), activeUserId, ); const decCipher = await this.cipherService.decrypt(updatedCipher, activeUserId); diff --git a/libs/common/src/vault/abstractions/cipher.service.ts b/libs/common/src/vault/abstractions/cipher.service.ts index 4b544b2a34e..72cf7c9ce44 100644 --- a/libs/common/src/vault/abstractions/cipher.service.ts +++ b/libs/common/src/vault/abstractions/cipher.service.ts @@ -169,7 +169,7 @@ export abstract class CipherService implements UserKeyRotationDataProvider; diff --git a/libs/common/src/vault/services/cipher.service.ts b/libs/common/src/vault/services/cipher.service.ts index c87a679dbf4..5e0a4e7452b 100644 --- a/libs/common/src/vault/services/cipher.service.ts +++ b/libs/common/src/vault/services/cipher.service.ts @@ -1959,7 +1959,7 @@ export class CipherService implements CipherServiceAbstraction { const fd = new FormData(); try { - const blob = new Blob([encData.buffer], { type: "application/octet-stream" }); + const blob = new Blob([encData.buffer as BlobPart], { type: "application/octet-stream" }); fd.append("key", dataEncKey[1].encryptedString); fd.append("data", blob, encFileName.encryptedString); fd.append("lastKnownRevisionDate", lastKnownRevisionDate.toISOString()); diff --git a/libs/vault/src/components/download-attachment/download-attachment.component.ts b/libs/vault/src/components/download-attachment/download-attachment.component.ts index bdca510c5aa..8135fd7b0b9 100644 --- a/libs/vault/src/components/download-attachment/download-attachment.component.ts +++ b/libs/vault/src/components/download-attachment/download-attachment.component.ts @@ -120,7 +120,7 @@ export class DownloadAttachmentComponent { this.fileDownloadService.download({ fileName: attachment.fileName, - blobData: decBuf, + blobData: decBuf as BlobPart, }); } catch { this.toastService.showToast({