Open jkomoros opened 5 years ago
*_count
s as wellThe "up to 10 seconds to run the cloud function" kills the use case for updating star_count and thread_count since users expect those to update immediately as feedback the action was succesful.
I don't think it actually does kill the use case for the 10 second delay, because the button itself they hit will update immediately. It's the secondary indicatior on the card that will take some time t update.
But this would allow radically simplifying security rules on cards, and also allow having a read_count on the cards
So we limit the transactions on the server.
As a bonus, this makes #66 easier to do because we'll already have cloud functions set up
As documented here: https://firebase.google.com/docs/firestore/solutions/aggregation