From 42e47ca17947a4abf53070fd73ac44aa5f39e150 Mon Sep 17 00:00:00 2001 From: Adam Jacob Date: Tue, 25 Jun 2024 11:20:24 -0700 Subject: [PATCH] bug(web): fix connection annotations We weren't parsing connection annotations correctly (we had all the logic, we just weren't calling it.) This fixes that. Signed-off-by: Adam Jacob --- lib/ts-lib/src/connection-annotations.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ts-lib/src/connection-annotations.ts b/lib/ts-lib/src/connection-annotations.ts index 5ea57c1932..ad1e7cf7b5 100644 --- a/lib/ts-lib/src/connection-annotations.ts +++ b/lib/ts-lib/src/connection-annotations.ts @@ -29,6 +29,16 @@ export function connectionAnnotationFitsReference( { tokens: targetCa }: ConnectionAnnotation, { tokens: referenceCa }: ConnectionAnnotation, ) { + // If the length is longer than 1, we assume you have already parsed the + // connection annotations. Otherwise, we need to parse them. + if (targetCa.length === 1) { + // @ts-ignore + targetCa = parseConnectionAnnotation(targetCa[0]); + } + if (referenceCa.length === 1) { + // @ts-ignore + referenceCa = parseConnectionAnnotation(referenceCa[0]); + } // a fitting target annotation is either the same as the reference one or a supertype thereof const lowerTargetCa = _.map(targetCa, (a) => a.toLowerCase()); const lowerReferenceCa = _.map(referenceCa, (a) => a.toLowerCase());