fix(editor): Fix execution list item selection (#5606)
* fix(editor): Fix execution list item selection * fix(editor): Delete only selected executions * fix(editor): Fix clear selection * fix(editor): Fix clear selection * fix(editor): Fix clear selection * feat(editor): Add select all existing executions checkbox * fix(editor): Do not mark later loaded executions selected * test(editor): Add execution list unit test * fix(editor): Fix selection * test(editor): update execution selection test * fix(editor): Handle UI state when there is no execution * fix(editor): Remove unnecessary logic * test(editor): Add more execution list unit tests and fake data generation * test(editor): Add more execution list unit tests * test(editor): Simplifying test setup * chore: update pnpm lock after resolving merge conflocts * chore: fix package version * fix: Improved executions deletion to prevent crashing and fixed removal of failed executions * fix: Add comment to clarify why change was needed * fix: fix executions list bug when selecting all and changing filter * fix: fix execution lists running execution showing up on different workflow id * fix(editor): Deleting an execution while all are selected * fix(editor): Deleting an execution while all are selected --------- Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Alex Grozav <alex@grozav.com>
This commit is contained in:
@@ -541,6 +541,9 @@ export class ExecutionsService {
|
||||
// delete executions by date, if user may access the underlying workflows
|
||||
where.startedAt = LessThanOrEqual(deleteBefore);
|
||||
Object.assign(where, requestFilters);
|
||||
if (where.status) {
|
||||
where.status = In(requestFiltersRaw!.status as string[]);
|
||||
}
|
||||
} else if (ids) {
|
||||
// delete executions by IDs, if user may access the underlying workflows
|
||||
where.id = In(ids);
|
||||
@@ -568,6 +571,10 @@ export class ExecutionsService {
|
||||
idsToDelete.map(async (id) => binaryDataManager.deleteBinaryDataByExecutionId(id)),
|
||||
);
|
||||
|
||||
await Db.collections.Execution.delete(idsToDelete);
|
||||
do {
|
||||
// Delete in batches to avoid "SQLITE_ERROR: Expression tree is too large (maximum depth 1000)" error
|
||||
const batch = idsToDelete.splice(0, 500);
|
||||
await Db.collections.Execution.delete(batch);
|
||||
} while (idsToDelete.length > 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user