mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-21 01:21:18 -08:00
PollEvent treated every m.reference child of a poll as a well formed vote, reading the answers with optional chaining and then dereferencing the result. m.relates_to is lifted out of the encrypted content, so a response that has not decrypted yet still resolves as a child of the poll while carrying no answers, and rendering the room threw. PollResponses had the same unguarded read. The vote total's reduce and a poll start with no answers threw on the same path. Also align vote counting with MSC3381, shared with the voter list: - max_selections defaults to 1 - an over long selection is truncated instead of spoiling the vote - an unknown answer id spoils the whole vote - an id repeated after truncation counts once