Skip to content

Commit

Permalink
fix: invalid filter function
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Jan 13, 2025
1 parent 91fb9e7 commit 9545cc3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion functions/issue-scraper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ async function issueScraper(username: string, supabase: SupabaseClient, voyageAp

const authorIdMap = await batchFetchAuthorIds(octokit, uniqueAuthors);

// Filter the issues to include only those with an valid title
// Filter the issues to include only those with a valid title
issues = issues.filter((issue) => {
if (!issue.title) {
storageFailed.push({
Expand All @@ -285,8 +285,22 @@ async function issueScraper(username: string, supabase: SupabaseClient, voyageAp
});
return false;
}
return true;
});

if (issues.length === 0) {
return JSON.stringify({
success: false,
stats: {
storageSuccessful: 0,
storageFailed: storageFailed.length,
},
issues: [],
storageFailed: storageFailed,
error: "No valid issues found to process"
}, null, 2);
}

const markdowns = issues.map((issue) => {
return `${issue.body || ""} ${issue.title}`;
});
Expand Down

0 comments on commit 9545cc3

Please sign in to comment.