Invalidate list of poll voters if full list size is different from the expected total count.

GitOrigin-RevId: 544e9c4ae8b76bb10399c8370269940eb45a4684
This commit is contained in:
levlam 2020-03-30 22:43:04 +03:00
parent e8e546a721
commit 7932ea08eb
2 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,6 @@
#include <cstring>
#include <iterator>
#include <limits>
#include <set>
#include <tuple>
#include <type_traits>
#include <unordered_map>

View File

@ -973,6 +973,10 @@ void PollManager::on_get_poll_voters(PollId poll_id, int32 option_id, int32 limi
if (static_cast<int32>(user_ids.size()) > limit) {
user_ids.resize(limit);
}
if (voters.next_offset.empty() && narrow_cast<int32>(voters.voter_user_ids.size()) != vote_list->count_) {
// invalidate_poll_option_voters(poll, poll_id, option_id);
voters.was_invalidated = true;
}
for (auto &promise : promises) {
promise.set_value({vote_list->count_, vector<UserId>(user_ids)});