From 9c2531f7e047512ea71a8c74704b12fd24a34282 Mon Sep 17 00:00:00 2001 From: jsy1218 <91580504+jsy1218@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:56:12 -0800 Subject: [PATCH] add test --- .../route-caching/dynamo-route-caching-provider.ts | 2 +- .../route-caching/dynamo-route-caching-provider.test.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts b/lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts index e31396ec3a..f5b584b61d 100644 --- a/lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts +++ b/lib/handlers/router-entities/route-caching/dynamo-route-caching-provider.ts @@ -167,7 +167,7 @@ export class DynamoRouteCachingProvider extends IRouteCachingProvider { ): CachedRoutes { metric.putMetric(`RoutesDbEntriesFound`, result.Items!.length, MetricLoggerUnit.Count) const cachedRoutesArr: CachedRoutes[] = result.Items!.map((record) => { - if (record.plainRoutes?.toString().trim() !== '') { + if (record.plainRoutes && record.plainRoutes?.toString().trim() !== '') { metric.putMetric(`RoutesDbEntryPlainTextRouteFound`, 1, MetricLoggerUnit.Count) const cachedRoutesJson = JSON.parse(record.plainRoutes) diff --git a/test/mocha/integ/handlers/router-entities/route-caching/dynamo-route-caching-provider.test.ts b/test/mocha/integ/handlers/router-entities/route-caching/dynamo-route-caching-provider.test.ts index 8e2283ac81..4aaf7c1b64 100644 --- a/test/mocha/integ/handlers/router-entities/route-caching/dynamo-route-caching-provider.test.ts +++ b/test/mocha/integ/handlers/router-entities/route-caching/dynamo-route-caching-provider.test.ts @@ -175,6 +175,7 @@ describe('DynamoRouteCachingProvider', async () => { it('Cached routes hits new cached routes lambda', async () => { spy.withArgs('CachingQuoteForRoutesDbRequestSentToLambdanewcachinglambda', 1, MetricLoggerUnit.Count) + spy.withArgs('RoutesDbEntryPlainTextRouteFound', 1, MetricLoggerUnit.Count) // testnet rolls out at 100% const newCachedRoutesRolloutPercent = NEW_CACHED_ROUTES_ROLLOUT_PERCENT[ChainId.SEPOLIA]