Skip to content

Commit ae7e680

Browse files
authored
fix: add missing entity id in FsEventMapper::getFromQueue() (#196)
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 <himself@claus-justus-heine.de>
1 parent f8566e5 commit ae7e680

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Db/FsEventMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function insertRow(string $type, string $userId, int $nodeId): Entity {
7272
*/
7373
public function getFromQueue(int $limit): array {
7474
$qb = $this->db->getQueryBuilder();
75-
$qb->selectDistinct(['user_id', 'type', 'node_id'])
75+
$qb->selectDistinct(['id', 'user_id', 'type', 'node_id'])
7676
->from($this->getTableName())
7777
->setMaxResults($limit);
7878

0 commit comments

Comments
 (0)