jsha / blocktogether

Share your blocks and subscribe to others'
GNU General Public License v3.0
330 stars 68 forks source link

stream should check for past actions before enqueuing #194

Open jsha opened 9 years ago

jsha commented 9 years ago

Right now, each time stream.js starts up, it reviews recent mentions and applies blocks as appropriate. For cases where the BtUsers follows the mentioner, those blocks are then cancelled by actions.js. However, this is unnecessarily wasteful of resources, and fills up the user-visible Actions list with cancelled actions, which are confusing.

Instead, when stream.js gets a mention, it should check whether there is any past action towards the mentioner, and not enqueue any action if there was. This replaces a write, read, write pattern with a read pattern, improving performance.