Skip to content

Commit 1f31677

Browse files
committed
fix(files-actions-menu): evict cache after the DB write, not before
Evicting before the write opens a window where a concurrent reader misses the cache, refetches the still-pre-write DB, and repopulates with stale data that sticks until the next register/unregister. Also avoids churning the cache when the write itself throws. Signed-off-by: Jaap van der Plas <jvdplas@gmail.com>
1 parent 747e363 commit 1f31677

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/Service/UI/FilesActionsMenuService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ public function registerFileActionMenu(string $appId, string $name, string $disp
6767
$entity->setOrder($order);
6868
$entity->setVersion($version);
6969
$entity->setDefaultAction($defaultAction);
70+
$result = $existing === null ? $this->mapper->insert($entity) : $this->mapper->update($entity);
7071
$this->resetCacheEnabled();
71-
return $existing === null ? $this->mapper->insert($entity) : $this->mapper->update($entity);
72+
return $result;
7273
} catch (Exception $e) {
7374
$this->logger->error(
7475
sprintf('Failed to register ExApp %s FileActionMenu %s. Error: %s', $appId, $name, $e->getMessage()), ['exception' => $e]

0 commit comments

Comments
 (0)