Skip to content

Poll Results counts inconsistent with Counters in the Poll page #47

Description

@evanhadfield

image
Poll Results: 1 participant, 21 votes

image
View Poll: 2 participants, 20 votes

Poll Results participant count incremented once the anonymous participant contributed a Statement and that Statement received any votes.
Poll Results participant count does not appear to increment just because a new anonymous participant contributes votes without any additional Statements, or any additional statements that haven't received votes yet.

It looks like the counters on the Poll page are correct, but the Poll Results (PollZone) are not counted the same way.

postgres=# SELECT 
  cm."name" AS "community_model_name",
  COUNT(DISTINCT p."uid") AS "unique_participants",
  COUNT(DISTINCT s."uid") AS "unique_statements",
  COUNT(DISTINCT v."uid") AS "unique_votes"
FROM "CommunityModel" cm
JOIN "Poll" po ON cm."uid" = po."communityModelId"
LEFT JOIN "Statement" s ON po."uid" = s."pollId"
LEFT JOIN "Vote" v ON s."uid" = v."statementId"
LEFT JOIN "Participant" p ON (s."participantId" = p."uid" OR v."participantId" = p."uid")
WHERE cm."name" = 'Local test'
  AND cm."deleted" = false
  AND po."deleted" = false
  AND (s."uid" IS NULL OR s."deleted" = false)
GROUP BY cm."name";
 community_model_name | unique_participants | unique_statements | unique_votes 
----------------------+---------------------+-------------------+--------------
 Local test           |                   5 |                13 |           29
(1 row)
image 5 Participants, 13 Statements, 29 Votes in Poll page

image
2 Participants, 13 Statements, 30 votes in Poll Results PollZone

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions