tuskyapp / Tusky

An Android client for the microblogging server Mastodon
https://tusky.app
GNU General Public License v3.0
2.42k stars 388 forks source link

Polls with no votes have the summary percentage of max uint32 value (on Akkoma at least) #2858

Open mjholub opened 1 year ago

mjholub commented 1 year ago

If a poll has no votes, instead of the results being 50%:50%, they are 2147483647% each. Seems to be related to #2802. Unsure if it only occurs with closed polls.


connyduck commented 1 year ago

Can not reproduce. Please link me a post where the problem occurs.

Screenshot_20221119_110759

mjholub commented 1 year ago

https://polxa.online/@kaea/109326057662849303 Screenshot_20221119-031823_Tusky

spacewasabi commented 1 year ago

Related issue (I think) :

I'm having weird results for polls and a wrong number of participants after answering to polls while connected to my account on Akkoma : Screenshot_2023-01-16-20-53-06-95_c38dddb2ed334becc5defa8615851593

majormajors commented 1 year ago

This issue seems to be present when using Tusky with Pleroma as well.

When I view a poll that came from a federated Mastodon instance, Pleroma (and I assume also Akkoma) seems to be sending down the correct votes_count but an incorrect voters_count (0 or 1 in all occurrences I've observed so far). Since Tusky defaults to using total voters to calculate poll percentages, these are obviously coming out to incorrect percentages. However, when I'm viewing a poll that originated on a Pleroma or Akkoma instance, the number of voters is correct and percentages are calculated properly.

There's a case to be made here that this is a bug in either Mastodon or Pleroma/Akkoma with the voter count not being federated properly.

The decision was made for Tusky to favor total voters over total votes at some point (https://github.com/tuskyapp/Tusky/commit/cf782f039f5b363141877228c911f3d7132a6492) for what I assume are good reasons, but reverting this back to using total votes would fix the issue for Pleroma and Akkoma users.

EDIT: I've confirmed that using total vote count fixes the issue for me after building and testing it locally.

EDIT 2: This seems to be the same issue as #2625