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>
This commit is contained in:
Côme Chilliet 2024-07-02 10:03:09 +02:00
parent b6aef4d235
commit 7c577c98ef
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
3 changed files with 4 additions and 3 deletions

View file

@ -60,8 +60,9 @@ class WebhookListener extends Entity implements \JsonSerializable {
protected $eventFilter;
/**
* @var string
* @var ?string
* If not empty, id of the user that needs to be connected for the webhook to trigger
* @psalm-suppress PropertyNotSetInConstructor
*/
protected $userIdFilter;

View file

@ -233,7 +233,7 @@ class WebhookListenerMapper extends QBMapper {
return $this->findEntities($qb);
}
private function buildCacheKey(?string $userIdFilter = ''): string {
private function buildCacheKey(?string $userIdFilter): string {
return self::EVENTS_CACHE_KEY_PREFIX.'_'.($userIdFilter ?? '');
}
}

View file

@ -54,7 +54,7 @@ class Version1000Date20240527153425 extends SimpleMigrationStep {
'notnull' => false,
]);
$table->addColumn('user_id_filter', Types::STRING, [
'notnull' => true,
'notnull' => false,
'length' => 64,
]);
$table->addColumn('headers', Types::TEXT, [