Skip to content

Commit

Permalink
fix(backend/local): listExecutions() regression (#128)
Browse files Browse the repository at this point in the history
* fix(backend/local): `listExecutions()` regression

* chore: changeset
  • Loading branch information
charlypoly authored Feb 28, 2024
1 parent 790b28a commit 17b344f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-bananas-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@defer/client": patch
---

Regression on local `listExecutions()`
13 changes: 9 additions & 4 deletions src/backend/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,18 @@ function isExecutionMatchFilter(
return false;

if (filters?.metadata && filters.metadata.length > 0 && execution.metadata) {
return filters.metadata
.filter((mdFilter) => mdFilter.values.length > 0)
.some((mdFilter) =>
const metadataFilters = filters.metadata.filter(
(mdFilter) => mdFilter.values.length > 0,
);
if (
!metadataFilters.some((mdFilter) =>
mdFilter.values.some(
(value) => execution.metadata[mdFilter.key] === value,
),
);
)
) {
return false;
}
}

if (
Expand Down

0 comments on commit 17b344f

Please sign in to comment.