Ignore ack and notification counts if notifications are blocked by the device (#27570)

* Ignore performance counts if notifications are blocked by the device

* Change the endpoint to allow more information

* Add tests and API description

* Remove wrong test

* Address feedback

* Only update the cache when there is no error

* Follow same casing as other props

* use one single endpoint

* Fix tests

* Fix i18n

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Daniel Espino García
2024-09-11 18:01:21 +02:00
коммит произвёл GitHub
родитель b9debc75a0
Коммит af503d9d45
13 изменённых файлов: 329 добавлений и 48 удалений

Просмотреть файл

@@ -1752,27 +1752,37 @@
put:
tags:
- users
summary: Attach mobile device
summary: Attach mobile device and extra props to the session object
description: >
Attach a mobile device id to the currently logged in session. This will
enable push notifications for a user, if configured by the server.
Attach extra props to the session object of the currently logged in session.
Adding a mobile device id will enable push notifications for a user,
if configured by the server.
Other props are also available, like whether the device has notifications
disabled and the mobile version.
##### Permissions
Must be authenticated.
operationId: AttachDeviceId
operationId: AttachDeviceExtraProps
requestBody:
content:
application/json:
schema:
type: object
required:
- device_id
properties:
device_id:
description: Mobile device id. For Android prefix the id with `android:`
and Apple with `apple:`
type: string
deviceNotificationDisabled:
description: Whether the mobile device has notifications disabled.
Accepted values are "true" or "false".
type: string
mobileVersion:
description: Mobile app version. The version must be parseable as a semver.
type: string
required: true
responses:
"200":