From ba9d6e94c30990874b4c2c5f46ca0e2873a77232 Mon Sep 17 00:00:00 2001 From: Sladuca Date: Sat, 2 Sep 2023 16:50:47 -0400 Subject: [PATCH] avoid context leakage in start() method --- actors/insertion-writer/src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actors/insertion-writer/src/index.ts b/actors/insertion-writer/src/index.ts index ba3c31dc2e..45fb47b338 100644 --- a/actors/insertion-writer/src/index.ts +++ b/actors/insertion-writer/src/index.ts @@ -30,10 +30,12 @@ export class InsertionWriter { } async start(queryThrottleMs?: number): Promise { - const logTip = (await this.insertionLog.getTip()) ?? "0-0"; + const logTip = await this.insertionLog.getTip(); this.logger.debug(`current log tip: ${logTip}`); - const logTipMerkleIndex = merkleIndexFromRedisStreamId(logTip); + const logTipMerkleIndex = logTip + ? merkleIndexFromRedisStreamId(logTip) + : undefined; this.logger.debug("starting iterator"); const newInsertionBatches = this.adapter.iterInsertions( logTipMerkleIndex ?? 0,