Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete posts that share a timestamp with a user
When a user is notified about a post, their last notified timestamp is set to the timestamp of the most recent post they were notified about. Before this commit, a post was only deleted when a user's timestamp is greater than its. Because a user's timestamp will necessarily be equal to that of at least one post in the database, this causes one post per user to be erroneously kept when it should be deleted. Deleting posts where a user shares its timestamp fixes this, and is safe to do because we can guarantee the user has already been notified about it. The only time that might not be true is if two posts are made during the same second (already unlikely) _and_ Wikidot refreshes the RSS feed between the two, including one but not the other. I consider this impossible. This is an O(n) problem, because there can be at most one post per user that falls afoul of this, but hey whatever
- Loading branch information