bigboringsystem/bigboringsystem — pull request #79 by spinda (2014-12-31 10:04:59+00:00)
Title: Clean up, refactor, fix bugs in lib/posts.js

This started as an attempt to add a "newer" button to the posts pagination and ended up as a refactor/clean up of the code in `lib/posts.js` and the bits connected to it.

- Multiple implementations of post streaming and pagination were merged into one.
- Fixed a bug where deleting an account would delete all posts that shared a creation time with any of the users' posts, rather than just the users' posts. Eliminated many unnecessary DB queries for this operation.
- Renaming of functions in `lib/posts.js` to better match what they do.
- General code cleanup/fixing.
- Saved a DB query when viewing the first page of "older" posts.
- Added support for retrieving posts before another post in addition to posts after a post. No UI is implemented for this yet, though I'd like to add it in if it'd be accepted.
- Fixed tests so they run `without` resetDB breaking them.