OpenBazaar-Server icon indicating copy to clipboard operation
OpenBazaar-Server copied to clipboard

Send only the latest duplicate follow notification in get_notification

Open jjeffryes opened this issue 9 years ago • 2 comments

When the get_notification API is called, it should only send the most recent follow notification from each guid.

Currently all follow notifications are sent from all guids, which allows a node to spam other nodes with follow notifications.

The unread count should reflect only the returned notifications, so that if 10 out of 12 unread notifications are duplicate follow notifications, the unread count is 2.

jjeffryes avatar Jul 13 '16 16:07 jjeffryes

IMO, the prevention of dupes in too short of a timespan should happen on the follow POST api (not GET). For any too frequent dupes the API should return an error and those shouldn't even make it into the DB, and therefore would not affect counts nor need to be filtered out.

Any type of filtering / offsetting of counts has proven to be complicated and error prone.

rmisio avatar Jul 13 '16 16:07 rmisio

Revised suggestion:

When your node gets a follow message from another node, if that user has sent a follow request within the last hour, your node should still accept the follow request, but the request should not generate a notification.

That way the current status of whether that user is following you is accurate, but spamming via follow notifications is prevented.

jjeffryes avatar Jul 13 '16 17:07 jjeffryes