From 14ca9b669c1a3cf8d053681d0fbaa42fe2882b2c Mon Sep 17 00:00:00 2001 From: boufni95 Date: Tue, 1 Apr 2025 18:37:12 +0000 Subject: [PATCH] more deb --- src/services/main/debitManager.ts | 2 +- src/services/storage/db/storageInterface.ts | 2 +- src/services/storage/tlv/tlvFilesStorageFactory.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/services/main/debitManager.ts b/src/services/main/debitManager.ts index 23fd8b2c..f16c2a57 100644 --- a/src/services/main/debitManager.ts +++ b/src/services/main/debitManager.ts @@ -186,7 +186,7 @@ export class DebitManager { this.notifyPaymentSuccess(appUser, debitRes, op, { appId: ctx.app_id, pub: req.npub, id: req.request_id }) return default: - throw new Error("invalid response type") + throw new Error("invalid debit response type") } } diff --git a/src/services/storage/db/storageInterface.ts b/src/services/storage/db/storageInterface.ts index 94a52fb0..ae97409a 100644 --- a/src/services/storage/db/storageInterface.ts +++ b/src/services/storage/db/storageInterface.ts @@ -148,7 +148,7 @@ export class StorageInterface extends EventEmitter { return } if (response.type !== op.type) { - reject(new Error('Invalid response type')); + reject(new Error('Invalid storage response type')); return } resolve(response.data); diff --git a/src/services/storage/tlv/tlvFilesStorageFactory.ts b/src/services/storage/tlv/tlvFilesStorageFactory.ts index 8d5ba554..d9329cad 100644 --- a/src/services/storage/tlv/tlvFilesStorageFactory.ts +++ b/src/services/storage/tlv/tlvFilesStorageFactory.ts @@ -12,7 +12,7 @@ export type TlvStorageInterface = { export class TlvStorageFactory extends EventEmitter { private process: ChildProcess; private isConnected: boolean = false; - private debug: boolean = true; + private debug: boolean = false; constructor() { super(); @@ -62,7 +62,7 @@ export class TlvStorageFactory extends EventEmitter { async LoadLatest(storageName: string, limit?: number): Promise { const opId = Math.random().toString() - const op: LoadLatestTlvOperation = { type: 'loadLatestTlv', opId, storageName, limit } + const op: LoadLatestTlvOperation = { type: 'loadLatestTlv', opId, storageName, limit, debug: true } const latestData = await this.handleOp(op) const deserializedLatestData: LatestData = {} for (const appId in latestData) { @@ -76,7 +76,7 @@ export class TlvStorageFactory extends EventEmitter { async LoadFile(storageName: string, appId: string, dataName: string, chunk: number): Promise { const opId = Math.random().toString() - const op: LoadTlvFileOperation = { type: 'loadTlvFile', opId, storageName, appId, dataName, chunk } + const op: LoadTlvFileOperation = { type: 'loadTlvFile', opId, storageName, appId, dataName, chunk, debug: true } const tlvFile = await this.handleOp(op) return { fileData: Buffer.from(tlvFile.base64fileData, 'base64'), chunks: tlvFile.chunks } } @@ -92,7 +92,7 @@ export class TlvStorageFactory extends EventEmitter { return } if (response.type !== op.type) { - reject(new Error('Invalid response type')); + reject(new Error('Invalid tlv storage response type')); return } resolve(response.data);