Unfortunately this is not free from races: the removal happens after the insertion allright, but there is no relationship between the corresponding messages to the unsubscriber, meaning that it could get them out of order.

One fix would be to make sure to only send one notification in any case and keep track of “odd” requests in the unsubscriber to correct the ordering after the fact.