Show real vote counts #3363

Open
feld wants to merge 1 commit from gitlab-mr-iid-2096 into develop
Owner

Polls have always shown an inaccurate vote count because it is trying to show the count of voters for your local instance. We have had the real vote counts for a long time now and it gets refreshed periodically until the poll closes and then a final vote count is fetched from the origin.

Fixing this makes the poll information more useful to users especially on smaller instances.

image{width=618 height=294}

Polls have always shown an inaccurate vote count because it is trying to show the count of voters for your local instance. We have had the real vote counts for a long time now and it gets refreshed periodically until the poll closes and then a final vote count is fetched from the origin. Fixing this makes the poll information more useful to users especially on smaller instances. ![image](/attachments/2a9389c5-2d7b-41d3-b414-fdaee7e6d0b7){width=618 height=294}
120 KiB
Member

So we don't have the people vote counts? I'm a bit confused with i18n removals

So we don't have the people vote counts? I'm a bit confused with i18n removals
Author
Owner

Displaying the count of local users who voted is not a useful metric

Displaying the count of local users who voted is not a useful metric
Member

I thought it wasn't about local users but about votes (single-option polls) vs people voted (multi-option polls)

I thought it wasn't about local users but about votes (single-option polls) vs people voted (multi-option polls)
Author
Owner

If that was the intention it has always been broken because for single-option polls it has only shown the number of local users who voted.

If that was the intention it has always been broken because for single-option polls it has only shown the number of local users who voted.
Author
Owner

I just checked on a remote multiple-choice poll and it says "94 votes" which matches the amount when adding up each poll option.

The data for the object says: "voters" => [] so we don't have any voters to count.

The problem is that we receive no data that can indicate to us how many poll options each voter selected.

Now it's down to a language game: in a multiple choice poll, if you select two options is it really "two votes"? Or perhaps "Two votes, but one submission/response"?

We were definitely making an assumption that doesn't match the data we have access to in the backend right now. Is it possible that behavior was different back in the OStatus days?

I just checked on a remote multiple-choice poll and it says "94 votes" which matches the amount when adding up each poll option. The data for the object says: `"voters" => []` so we don't have any voters to count. The problem is that we receive no data that can indicate to us how many poll options each voter selected. Now it's down to a language game: in a multiple choice poll, if you select two options is it really "two votes"? Or perhaps "Two votes, but one submission/response"? We were definitely making an assumption that doesn't match the data we have access to in the backend right now. Is it possible that behavior was different back in the OStatus days?
Member

i don't think we had polls in OStatus days

i don't think we had polls in OStatus days
Member

So basically we don't and can't know number of voters, just number of votes? I guess it's ok to remove that counter there, but we should also do it for backend.

So basically we don't and can't know number of voters, just number of votes? I guess it's ok to remove that counter there, but we should also do it for backend.
Show real vote counts
All checks were successful
opencode/review OpenCode execution completed
opencode/fix OpenCode fixes published
c06945433a

/oc review

/oc review
Owner

OpenCode Review

Execution completed for pleroma/pleroma-fe at c06945433a7d (job #57).

Rating: 5/5

Single-commit PR that makes the poll footer always show total votes (polls.votes_count) instead of preferring voters_count, since the backend cannot provide real voter counts for federated polls. The dead people_voted_count i18n key is removed from all 23 locales that had it, and a valid changelog.d entry is added. Verified: no remaining references to people_voted_count or voters_count anywhere; all changed locale files are valid JSON and every locale retains polls.votes_count; ESLint/Vue SFC parse passes; changelog convention satisfied. Behavior only changes for multiple-choice polls (total votes instead of local-voter count), which matches the PR intent and maintainer discussion. Unit tests are Playwright-browser-based and unavailable here, but no poll tests exist and the change is template/i18n-only. No defects found.

No findings were reported.

Merge-ready: minimal, correct, and self-consistent template/i18n cleanup that matches the maintainer discussion; all keys, references, JSON validity, lint, and changelog conventions verified clean.


Last reviewed commit: c06945433a7d

<!-- opencode-review:v1:5deeca3044fcf7823dd5807c9304c745 --> <!-- opencode-reviewed-head:c06945433a7da290a1d69c4a4aefbf2d31e5245b --> ## OpenCode Review _Execution completed for `pleroma/pleroma-fe` at `c06945433a7d` (job #57)._ Rating: **5/5** Single-commit PR that makes the poll footer always show total votes (polls.votes_count) instead of preferring voters_count, since the backend cannot provide real voter counts for federated polls. The dead people_voted_count i18n key is removed from all 23 locales that had it, and a valid changelog.d entry is added. Verified: no remaining references to people_voted_count or voters_count anywhere; all changed locale files are valid JSON and every locale retains polls.votes_count; ESLint/Vue SFC parse passes; changelog convention satisfied. Behavior only changes for multiple-choice polls (total votes instead of local-voter count), which matches the PR intent and maintainer discussion. Unit tests are Playwright-browser-based and unavailable here, but no poll tests exist and the change is template/i18n-only. No defects found. No findings were reported. Merge-ready: minimal, correct, and self-consistent template/i18n cleanup that matches the maintainer discussion; all keys, references, JSON validity, lint, and changelog conventions verified clean. --- _Last reviewed commit: `c06945433a7d`_

/oc fix please fix the merge conflicts

/oc fix please fix the merge conflicts
Owner

OpenCode Requested Fix

Based on exact source commit c06945433a7d after integrating exact target commit 7e8f63c71420 (fix job #58).

Custom request

please fix the merge conflicts

Companion PR: pleroma/pleroma-fe#3566

Merge this companion PR into the original source branch to retain the integrated target-branch ancestry.

Solution

Merged target commit 7e8f63c into PR head c0694543 and resolved the two merge conflicts (src/i18n/eo.json, src/i18n/ja_pedantic.json). Both conflicts stemmed from the PR removing the dead people_voted_count i18n key while the target modified adjacent polls keys. Resolution: remove people_voted_count everywhere per PR intent, while preserving all target-side content — eo.json keeps the target's newly added expires_at/expired_at/non_anonymous/non_anonymous_title keys with corrected comma placement, and ja_pedantic.json keeps the target's Weblate-collapsed votes_count value ("{count} 票") rather than reverting it to the old duplicated plural. The merged poll.vue combines the target's non_anonymous footer badge with the PR's always-show votes_count simplification. Verified every locale's polls object equals the target's version minus people_voted_count, all 35 i18n files parse as valid JSON, no references to people_voted_count/voters_count remain in src/, and no conflict markers remain.

Published in 2788402a78aa.

Tests reported by the fixer:

  • node JSON.parse validation of all 35 src/i18n/*.json files (all valid, polls.votes_count intact, people_voted_count fully removed, every polls object equals target 7e8f63c minus people_voted_count)
  • yarn exec biome check src/i18n/ (clean)
  • yarn exec eslint src/components/poll/poll.vue (clean, exit 0)
  • git diff --check across merged tree (no leftover conflict markers)
<!-- opencode-review:v1:3575c898dea1b381daacdc6b9d916014 --> <!-- opencode-reviewed-head:c06945433a7da290a1d69c4a4aefbf2d31e5245b --> ## OpenCode Requested Fix _Based on exact source commit `c06945433a7d` after integrating exact target commit `7e8f63c71420` (fix job #58)._ ### Custom request <pre>please fix the merge conflicts</pre> Companion PR: [pleroma/pleroma-fe#3566](https://git.pleroma.social/pleroma/pleroma-fe/pulls/3566) Merge this companion PR into the original source branch to retain the integrated target-branch ancestry. ### Solution Merged target commit 7e8f63c into PR head c0694543 and resolved the two merge conflicts &#40;src/i18n/eo&#46;json, src/i18n/ja&#95;pedantic&#46;json&#41;&#46; Both conflicts stemmed from the PR removing the dead people&#95;voted&#95;count i18n key while the target modified adjacent polls keys&#46; Resolution: remove people&#95;voted&#95;count everywhere per PR intent, while preserving all target&#45;side content — eo&#46;json keeps the target's newly added expires&#95;at/expired&#95;at/non&#95;anonymous/non&#95;anonymous&#95;title keys with corrected comma placement, and ja&#95;pedantic&#46;json keeps the target's Weblate&#45;collapsed votes&#95;count value &#40;"&#123;count&#125; 票"&#41; rather than reverting it to the old duplicated plural&#46; The merged poll&#46;vue combines the target's non&#95;anonymous footer badge with the PR's always&#45;show votes&#95;count simplification&#46; Verified every locale's polls object equals the target's version minus people&#95;voted&#95;count, all 35 i18n files parse as valid JSON, no references to people&#95;voted&#95;count/voters&#95;count remain in src/, and no conflict markers remain&#46; Published in [`2788402a78aa`](https://git.pleroma.social/pleroma/pleroma-fe/commit/2788402a78aa34e754ca9ce19ea1378cd446c88f). Tests reported by the fixer: - node JSON&#46;parse validation of all 35 src/i18n/&#42;&#46;json files &#40;all valid, polls&#46;votes&#95;count intact, people&#95;voted&#95;count fully removed, every polls object equals target 7e8f63c minus people&#95;voted&#95;count&#41; - yarn exec biome check src/i18n/ &#40;clean&#41; - yarn exec eslint src/components/poll/poll&#46;vue &#40;clean, exit 0&#41; - git diff &#45;&#45;check across merged tree &#40;no leftover conflict markers&#41;
All checks were successful
opencode/review OpenCode execution completed
opencode/fix OpenCode fixes published
This pull request has changes conflicting with the target branch.
  • src/i18n/eo.json
  • src/i18n/ja_pedantic.json
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin gitlab-mr-iid-2096:gitlab-mr-iid-2096
git switch gitlab-mr-iid-2096

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff gitlab-mr-iid-2096
git switch gitlab-mr-iid-2096
git rebase develop
git switch develop
git merge --ff-only gitlab-mr-iid-2096
git switch gitlab-mr-iid-2096
git rebase develop
git switch develop
git merge --no-ff gitlab-mr-iid-2096
git switch develop
git merge --squash gitlab-mr-iid-2096
git switch develop
git merge --ff-only gitlab-mr-iid-2096
git switch develop
git merge gitlab-mr-iid-2096
git push origin develop
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma-fe!3363
No description provided.