diff --git a/lib/Service/DeckIntegrationService.php b/lib/Service/DeckIntegrationService.php index d2e5007..78a07d0 100644 --- a/lib/Service/DeckIntegrationService.php +++ b/lib/Service/DeckIntegrationService.php @@ -191,8 +191,14 @@ class DeckIntegrationService { } /** - * Cards in the given stack that are neither archived nor marked done, - * enriched so getAssignedUsers()/getLabels() are populated. + * Cards in the given stack that are neither archived, deleted nor marked + * done, enriched so getAssignedUsers()/getLabels() are populated. + * + * The `deletedAt` check is not redundant: Deck's + * `CardMapper::findAllByStack()` filters on `stack_id` and + * `archived = false` only, so cards sitting in the trash come back too — + * they are kept until Deck's own DeleteCron purges them. Without this we + * would move cards the user already deleted. * * @return Card[] */ @@ -205,6 +211,9 @@ class DeckIntegrationService { $cards = $cardService->enrichCards($cards); return array_values(array_filter($cards, static function (Card $card) { + if (method_exists($card, 'getDeletedAt') && (int)$card->getDeletedAt() > 0) { + return false; + } return !$card->getArchived() && $card->getDone() === null; })); }, []);