[backend] implement lastnotification pruning