1
0
Fork 0
mirror of synced 2024-06-30 04:00:34 +12:00

Merge branch '1.5.x' into feat-push-images

This commit is contained in:
Jake Barnby 2024-02-21 18:06:58 +13:00 committed by GitHub
commit 9b251207cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -2113,6 +2113,13 @@ $commonCollections = [
'lengths' => [],
'orders' => [],
],
[
'$id' => ID::custom('_unique_target_topic'),
'type' => Database::INDEX_UNIQUE,
'attributes' => ['targetInternalId', 'topicInternalId'],
'lengths' => [],
'orders' => [],
],
[
'$id' => ID::custom('_fulltext_search'),
'type' => Database::INDEX_FULLTEXT,

View file

@ -444,6 +444,17 @@ trait MessagingBase
$this->assertEquals($target['body']['userId'], $response['body']['target']['userId']);
$this->assertEquals($target['body']['providerType'], $response['body']['target']['providerType']);
// Test duplicate subscribers not allowed
$failure = $this->client->call(Client::METHOD_POST, '/messaging/topics/' . $topics['public']['$id'] . '/subscribers', \array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'subscriberId' => ID::unique(),
'targetId' => $target['body']['$id'],
]);
$this->assertEquals(409, $failure['headers']['status-code']);
$topic = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topics['public']['$id'], [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],