From f698377f71407143f2baa944b8cc03f2431f3b63 Mon Sep 17 00:00:00 2001 From: Shivaditya Shivganesh Date: Sat, 9 Nov 2024 02:53:31 -0500 Subject: [PATCH] fix: updated the match filter for the issues --- src/adapters/supabase/helpers/issues.ts | 3 +-- src/handlers/issue-deduplication.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/adapters/supabase/helpers/issues.ts b/src/adapters/supabase/helpers/issues.ts index f364abf..d00781c 100644 --- a/src/adapters/supabase/helpers/issues.ts +++ b/src/adapters/supabase/helpers/issues.ts @@ -59,12 +59,11 @@ export class Issues extends SuperSupabase { plaintext = null; } const issues = await this.getIssue(issueNodeId); - if (issues && issues.length == 0) { + if (!issues) { this.context.logger.info("Issue does not exist, creating a new one"); await this.createIssue(issueNodeId, payload, isPrivate, markdown, authorId); } else { const { error } = await this.supabase.from("issues").update({ markdown, plaintext, embedding, payload, modified_at: new Date() }).eq("id", issueNodeId); - if (error) { throw new Error("Error updating issue: " + error.message); } diff --git a/src/handlers/issue-deduplication.ts b/src/handlers/issue-deduplication.ts index 9fc01c4..b667a7b 100644 --- a/src/handlers/issue-deduplication.ts +++ b/src/handlers/issue-deduplication.ts @@ -61,7 +61,7 @@ export async function issueChecker(context: Context): Promise { }); return true; } - if (similarIssues.length > 0) { + if (processedIssues.length > 0) { logger.info(`Similar issue which matches more than ${context.config.warningThreshold} already exists`); await handleSimilarIssuesComment(context, payload, issueBody, issue.number, processedIssues); return true;