Commit Graph

5 Commits

Author SHA1 Message Date
Vinoth Kannan fc4d23174e
PERF: exclude vote fields in `topic-list-item` serializer for PMs. (#103)
We shouldn't add vote fields for personal messages since users can't vote there. If we include then it's creating an N+1 issue in the `private-messages-all` endpoint.
2021-09-16 18:56:02 +05:30
Osama Sayegh 8dbc75f965
FIX: Upsert topic votes count atomically (#71)
The `Topic#update_vote_count` method should be concurrency-safe to prevent unique constraint violation errors when multiple processes try to insert a topic_votes_count record for the same topic simultaneously.

Signed-off-by: OsamaSayegh <asooomaasoooma90@gmail.com>
2021-01-07 07:26:52 +03:00
Jarek Radosz b92385aada
FIX: Delete the votes on user removal (#59)
There are some assumptions in the code that `vote.user` exists. It makes sense to boop the votes out of existence when their owner is destroyed.
2020-10-06 18:04:26 +02:00
Krzysztof Kotlarek e2c2f51799 FIX: dont error when topic without category 2020-08-17 16:18:16 +10:00
Krzysztof Kotlarek 0f0e76f170
FIX: move data to separate tables (#52)
We are trying to avoid custom tables. Changes:
CategoryCustomField -> DiscourseVoting::CategorySetting # contains infromation if voting is enabled for category
UserCustomField -> DiscourseVoting::Vote # user's votes
TopicCustomField -> DiscourseVoting::VoteCounter # cache count for topics
2020-08-17 15:01:33 +10:00