raiden-network / raiden

Raiden Network

Home Page:https://developer.raiden.network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GET `api/v1/notifications` is not idempotent

manuelwedler opened this issue · comments

Problem Definition

A GET api/v1/notifications request returns only new notifications since the last request to the endpoint. The API deletes all notifications when this endpoint is called.
This is a clear misuse of the HTTP GET method, as it should always be idempotent and should never change resources in the raiden client. It would be better if the endpoint would return all notifications that are currently relevant. Notifications should only be removed if they are not relevant anymore, for example after the user deposits to the UDC the low RDN notification should be removed.

System Description

raiden v2.0.0

We could change the request to GET api/v1/notifications?since=NOTIFICATION_ID (and limit maximum amount of returned messages).

That would only solve the idempotence issue, not how notifications get removed.

I agree with @manuelwedler that their lifecycle should be managed from where they were created.