From b553b6eabdf9a12075414b75168deff8beeafc69 Mon Sep 17 00:00:00 2001 From: Claus-Justus Heine Date: Tue, 25 Nov 2025 11:03:39 +0100 Subject: [PATCH] fix: add missing entity id in FsEventMapper::getFromQueue() The FileSystemListener background job tries to delete events from the queue if the home-dir of the user cannot be found (e.g. because the user account has been removed): https://github.com/rotdrop/nextcloud-app-context-chat/blob/f8566e58d3a384d67615163ef0ac4cf13f276746/lib/BackgroundJobs/FileSystemListenerJob.php#L104 However, this call to `FsEventMapper::delete()` cannot succeed if the entity id is missing, as is currently the case because ATM `FsEventMapper::getFromQueue()` omits the id in its result "entities" (which are in fact then only partial entities). Another way to fix this would be to use `FsEventMapper::deleteByContent()` instead. Signed-off-by: Claus-Justus Heine --- lib/Db/FsEventMapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Db/FsEventMapper.php b/lib/Db/FsEventMapper.php index 69de0a9a..93ae2b1c 100644 --- a/lib/Db/FsEventMapper.php +++ b/lib/Db/FsEventMapper.php @@ -72,7 +72,7 @@ public function insertRow(string $type, string $userId, int $nodeId): Entity { */ public function getFromQueue(int $limit): array { $qb = $this->db->getQueryBuilder(); - $qb->selectDistinct(['user_id', 'type', 'node_id']) + $qb->selectDistinct(['id', 'user_id', 'type', 'node_id']) ->from($this->getTableName()) ->setMaxResults($limit);