notifications
notifications
Register Device
Register or update an FCM device token for push notifications.
Read-then-insert is a race, and device_tokens.fcm_token is UNIQUE. The app registers on launch and Firebase can hand the same token to two in-flight requests, so two of them found no row and both inserted. The UniqueViolation escaped all the way to the CORS middleware, which answered 500 with the raw psycopg2 text in the body. Three of those in the week of 21 September.
An upsert is what this always meant. It is written as insert-then-repair rather than one ON CONFLICT statement because the conflicting row may belong to ANOTHER user (a shared device, a reinstall), and reassigning it is the behaviour this endpoint has always had.
post/notifications/register-device
Request
- Base URLhttps://api.fluentea.com (the document declares no server; this is the origin it was published from)
- URLhttps://api.fluentea.com/notifications/register-device
- Authnone declared
Headers
authorizationstring nullable
Request body
Response
Successful Response
unknown required
Changes
No operation changes recorded.