Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/sync/seen-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class QueryCache {

async sync(rawQueries: RawRecentQuery[]): Promise<RecentQuery[]> {
// TODO: bound the concurrency
return await Promise.all(rawQueries.map(async (rawQuery) => {
const results = await Promise.allSettled(rawQueries.map(async (rawQuery) => {
const key = await this.store(rawQuery);
try {
return await RecentQuery.analyze(rawQuery, key, this.getFirstSeen(key));
Expand All @@ -59,6 +59,9 @@ export class QueryCache {
throw error;
}
}));
return results
.filter((r): r is PromiseFulfilledResult<RecentQuery> => r.status === "fulfilled")
.map((r) => r.value);
}

reset(): void {
Expand Down
Loading