Skip to content

Commit 2eda7ed

Browse files
committed
fix(webhook_listeners): Allow null for user_id_filter for oracle
Empty string and null are the same thing on oracle databases so we have to allow it. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 148dbe2 commit 2eda7ed

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

apps/webhook_listeners/lib/Db/WebhookListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ class WebhookListener extends Entity implements \JsonSerializable {
6060
protected $eventFilter;
6161

6262
/**
63-
* @var string
63+
* @var ?string
6464
* If not empty, id of the user that needs to be connected for the webhook to trigger
65+
* @psalm-suppress PropertyNotSetInConstructor
6566
*/
6667
protected $userIdFilter;
6768

apps/webhook_listeners/lib/Db/WebhookListenerMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function getByEvent(string $event, ?string $userId = null): array {
220220
return $this->findEntities($qb);
221221
}
222222

223-
private function buildCacheKey(?string $userIdFilter = ''): string {
223+
private function buildCacheKey(?string $userIdFilter): string {
224224
return self::EVENTS_CACHE_KEY_PREFIX.'_'.($userIdFilter ?? '');
225225
}
226226
}

apps/webhook_listeners/lib/Migration/Version1000Date20240527153425.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
5454
'notnull' => false,
5555
]);
5656
$table->addColumn('user_id_filter', Types::STRING, [
57-
'notnull' => true,
57+
'notnull' => false,
5858
'length' => 64,
5959
]);
6060
$table->addColumn('headers', Types::TEXT, [

0 commit comments

Comments
 (0)