Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voting delegation bug #223

Closed
MSoeb opened this issue Aug 11, 2023 · 6 comments · Fixed by #227
Closed

Voting delegation bug #223

MSoeb opened this issue Aug 11, 2023 · 6 comments · Fixed by #227
Milestone

Comments

@MSoeb
Copy link

MSoeb commented Aug 11, 2023

Description: If a user could vote for another user, the meesage "Voting succesful" won't appear, instead the voting buttons are still active and the user could click again on them. Correctly a error message is shown.

Addtionally: After page reload the clicked button of delegation is once more not colored.

example - first vote is done. second one also, but buttons still active.
Screenshot_20230811_160912

Reproduction
precondition: Two users in a meeting are needed with a vote delegation from A (group admin) to B (group delegates).

  1. open a meeting
  2. open elections > create a new election > add one user to the candidate list > create a new ballot for a list election and choose admin and delegates as groups which are allowed to vote > save and start the voting

What should happen:
If a user has voted, the buttons should disappear and the message "Voting succesful." should appear. So the user can easily see, that the vote was correctly send.

@MSoeb MSoeb added this to the 4.1 milestone Aug 11, 2023
@luisa-beerboom luisa-beerboom self-assigned this Aug 16, 2023
@luisa-beerboom
Copy link
Member

Investigated this and found out that this happens because the vote-service's voted route doesn't deliver the id for the user in question.
This doesn't happen if the delegation is for another delegate, it happens only if the delegation is an admin (while the operator is in the delegate group).

This is clearly a vote-service bug, so I am transferring it there

@luisa-beerboom luisa-beerboom transferred this issue from OpenSlides/openslides-client Aug 16, 2023
@luisa-beerboom luisa-beerboom removed their assignment Aug 16, 2023
@MSoeb MSoeb changed the title [RTF + Staging] Voting delegation bug Voting delegation bug Aug 21, 2023
@rrenkert rrenkert added the needs investigation The cause for a bug is not clear enough, so it has to be investigated for some time label Aug 22, 2023
@Elblinator Elblinator removed the needs investigation The cause for a bug is not clear enough, so it has to be investigated for some time label Aug 28, 2023
@Elblinator
Copy link
Member

After testing this behaviour with different combinations of delegated votes (deli to deli, admin to deli, etc.) we did not figure a combination out for which the bug does not happen.

Meaning so far this bug happens for every delegated vote

@ostcar
Copy link
Member

ostcar commented Aug 28, 2023

I can not reproduce this. Please tell me step by step what to do.

If I create to delegates and delegate the vote from d2 to d1 and vote for both, the request:

./openslides-performance -u d1 -p pass request /system/vote/voted?ids=3

returns

{"3":[3,4]}

So I can see, that for the poll with ID 3 the users with id 3 (user d1) and 4 (user d2) have voted. Did you expect something else?

@Elblinator
Copy link
Member

Step by step guide of what I did:
tested on testintern.staging
creating the votes:

  • create an election (delegates are entitled to vote, voting method: yes per candidate, 100%-base: all valid ballots, duration short); start the election
  • create a motion vote (delegates are entitled to vote, 100%-Base: Yes/No/Abstain, duration:short); start the vote
  • create an agenda vote (delegates are entitled to vote, voting method: yes per option, duration: short), start vote

creating the delegates:

  • activate vote delegation
  • create two delegates (d1 and d2)
  • delegate vote from d2 to d1

as the delegate:

  • open participant list
  • press on the banner on top or go to autopilot
  • vote for oneself and for the delegated votes

result: the buttons for the delegates do not disappear
it returns:

 {724: [6176], 725: [6176], 726: [6176]}

the ids from the three different votes and the one id from d1

additional info:

  1. even with the buttons present d1 cannot vote for d2 again. If they try, they get the following error:
Error: You have already voted.
  1. even if the poll are opened not over the autopilot, but their respective other route ( e.g. elections > specific election) the wrong behaviour occurs

@ostcar
Copy link
Member

ostcar commented Aug 29, 2023

I did all you steps in a localprod environment and can not reproduce the error. In my case, it returns

{"6":[3,4],"7":[3,4],"8":[3,4]}

as expected

The versions I am running are:

git submodule status
+687a4729cbc98c6241c76efa997eca0dcf05c721 openslides-auth-service (4.0.0-21-g687a472)
+0baff70bec2372f8c5f1df145ee07b8522e4608e openslides-autoupdate-service (v0.1.0-620-g0baff70)
+d8511f5138db4cc5fe4fa35e2a0200f766bd49c5 openslides-backend (4.0.0-226-gd8511f51)
+b11ff6f80e7572dd7d4e05adfa9e221264cec025 openslides-client (4.0.0-364-gb11ff6f80)
+eeb4ad0d45935be420f50751ff7511e8b6f1d60d openslides-datastore-service (4.0.0-27-geeb4ad0)
+70dc818a8d71fc4b7ea0a5650c96bc857023ae14 openslides-icc-service (4.0.0-31-g70dc818)
+f58d71b82d2dabfe11710b91120f9e9e139c8b65 openslides-manage-service (4.0.7-4-gf58d71b)
+8d464bd55c7980108e1999940f3921ffffe00e4f openslides-media-service (4.0.0-9-g8d464bd)
+a5e277bc2a57b936dda2314cf93143827f362cd3 openslides-vote-service (4.0.0-58-ga5e277b)

Can you tell me the versions of testintern.staging?

ostcar added a commit to ostcar/openslides-vote-service that referenced this issue Aug 29, 2023
The old version used the meeting_user_id as user_id

Fixes OpenSlides#223
@ostcar
Copy link
Member

ostcar commented Aug 29, 2023

I found the bug.

It was a bug in the rtf-branch. When I translated the user_$_ fields to the meeting_user fields, I did a mistake and used the meeting_user.id as user.id.

I did the same mistake when I changed the unit-test, so the unit test did not catch this.

When I tried to reproduce it here, I only used one meeting, therefore the user.id == meeting_user.id and everything worked.

PR #227 should fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants