raiden icon indicating copy to clipboard operation
raiden copied to clipboard

GET `api/v1/notifications` is not idempotent

Open manuelwedler opened this issue 4 years ago • 2 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

manuelwedler avatar Aug 03 '21 09:08 manuelwedler

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

karlb avatar Aug 05 '21 11:08 karlb

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.

ulope avatar Aug 09 '21 12:08 ulope