Skip to content

Commit bbd3eaa

Browse files
committed
fix(webapp): keep the search filter on the ranked queue list's tail
The tail query's exclusion list overwrote the search's name filter via object spread, so searching while sorted by activity showed unrelated queues past the ranked head. Combine the conditions with AND instead.
1 parent 3c67a0c commit bbd3eaa

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/webapp/app/presenters/v3/QueueListPresenter.server.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,10 @@ export class QueueListPresenter extends BasePresenter {
281281
}
282282
excludedNames = (allRows ?? []).map((row) => row.queue_name);
283283
}
284+
// AND keeps the search's name filter intact alongside the exclusion (a spread
285+
// would overwrite one name condition with the other).
284286
tailQueues = await this._replica.taskQueue.findMany({
285-
where: { ...where, name: { notIn: excludedNames } },
287+
where: { AND: [where, { name: { notIn: excludedNames } }] },
286288
select: queueListSelect,
287289
orderBy: {
288290
orderableName: "asc",
@@ -314,7 +316,7 @@ export class QueueListPresenter extends BasePresenter {
314316
return [];
315317
}
316318
const queues = await this._replica.taskQueue.findMany({
317-
where: { ...where, name: { in: names } },
319+
where: { AND: [where, { name: { in: names } }] },
318320
select: queueListSelect,
319321
});
320322
const byName = new Map(queues.map((queue) => [queue.name, queue]));

0 commit comments

Comments
 (0)