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

🐛 Endless Poll Creation Loop Displays Multiple Results #2357

Closed
kneerose opened this issue Nov 8, 2024 · 14 comments
Closed

🐛 Endless Poll Creation Loop Displays Multiple Results #2357

kneerose opened this issue Nov 8, 2024 · 14 comments
Assignees
Labels
🐛 Bug Something isn't working 📜 Proposal Pillar

Comments

@kneerose
Copy link
Contributor

kneerose commented Nov 8, 2024

Area

Proposal Pillar

Domain

dev-sanchogov.tools

Which wallet were you using?

No response

Context

While attempting to view the poll results for a proposal, I noticed that after closing a poll, the "Add Poll" button becomes visible. This allows a new poll to be added, which generates another set of results. Repeating this process results in an endless loop where multiple poll results are displayed.

Steps to reproduce

  1. Connect your wallet.
  2. Create a new proposal or navigate to an existing one.
  3. Add a poll.
  4. Close the poll.
  5. Notice that the "Add Poll" button reappears and allows a new poll to be added.
  6. Repeat the process and observe that each cycle generates a new poll result.

Actual behavior

The system allows multiple poll results to be generated as polls can be repeatedly added and closed.
https://dev-sanchonet.govtool.byron.network/proposal_discussion/2029
image

Expected behavior

The "Add Poll" action should be restricted by the API once the poll has been closed, preventing further additions. Alternatively, only the latest poll result should be visible, and multiple results should not be displayed.

@kneerose
Copy link
Contributor Author

@nebojsajsimic any update on this ? I am still able to reproduce this issue
https://dev-sanchonet.govtool.byron.network/proposal_discussion/2176
CC: @bosko-m

@bosko-m
Copy link
Contributor

bosko-m commented Dec 4, 2024

Can you test now @kneerose ?

@kneerose
Copy link
Contributor Author

kneerose commented Dec 5, 2024

@bosko-m , I am still able to reproduce this
https://dev-sanchonet.govtool.byron.network/proposal_discussion/2433

image

@bosko-m
Copy link
Contributor

bosko-m commented Dec 5, 2024

@nebojsact ?

@nebojsact
Copy link

I'll check this again, fix on alternative way so we will display only last created poll.

@kneerose
Copy link
Contributor Author

kneerose commented Dec 9, 2024

@nebojsact I am still able to reproduce this issue:

  • The "Add Poll" button is visible even after the poll has been closed.
  • Additionally, the API allows the creation of a new poll, regardless of whether the previous poll is closed or not.

Dev Environment
https://dev-sanchonet.govtool.byron.network/proposal_discussion/2521
image

Preview Environment
https://preview.gov.tools/proposal_discussion/683
image

CC: @bosko-m

@nebojsact
Copy link

nebojsact commented Dec 9, 2024 via email

@kneerose
Copy link
Contributor Author

@nebojsact , does this mean a user can vote on multiple polls for the same proposal? For instance, if a user has already voted on one poll and the poll owner closes it, then opens a new poll, can the same user vote again on the new poll for the same proposal?

Additionally, based on your comments, if the poll owner closes a poll with more responses and subsequently opens and closes a new poll, does this mean the results of the old poll will be discarded?

  • The API currently allows the creation of a new poll even if the previous poll remains open. As a result, using the API to create multiple polls causes the "Close" button to appear multiple times for each poll created. The API should enforce a restriction to block the creation of a new poll for the same proposal if an existing poll is already open and not closed.

https://www.loom.com/share/19f879a3df854c879c1d9ff7277fb5de?sid=de71a437-ade5-4050-987e-8d3605cd223c

@nebojsact
Copy link

@kneerose as the logic for the poll was in place for opening and closing, I suppose that was made by request and description of functionality, yes if the user closes the poll, edit proposal and open new poll it is normal that old will be discarded. So @bosko-m can you help us with this logic?
@kneerose also please open a new bug for new request and close this if everything from the initial request was resolved. Thanks!

@bosko-m
Copy link
Contributor

bosko-m commented Dec 10, 2024

@kneerose @nebojsact
Here is the expected behavior:

  • There can only be one poll active at the time (if thats not the case, please create the new ticket as it goes outside of the scope of this bug).
  • The last closed poll should be shown
  • Once the proposal has been submitted on chain, no new polls can be created and commenting should be off too.
    Let me know if you have any questions.

@kneerose
Copy link
Contributor Author

@nebojsact ,
I have created a separate ticket for the backend poll creation issue #2507.

Current behaviour of proposal poll on frontend

  • When a proposal owner adds, edits, and closes a poll, and then adds a new poll, the UI renders as

image

  • If the owner closes the new poll, the poll results are updated to reflect the new poll's results

image

NOTE: If this is the expected and intended behavior for the UI, this ticket can be considered closable.

CC: @bosko-m

@bosko-m
Copy link
Contributor

bosko-m commented Dec 11, 2024

@kneerose In regards to your second part: "If the owner closes the new poll, the poll results are updated to reflect the new poll's results", what do you mean? Poll results are updated everywhere or only the last one (which I think should be right)?

@kneerose
Copy link
Contributor Author

@bosko-m , after closing the new poll, the results are updated, and only the updated poll results are displayed.

image

@bosko-m
Copy link
Contributor

bosko-m commented Dec 11, 2024

All good, understood.
Thank you @kneerose

@bosko-m bosko-m closed this as completed Dec 11, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Govtool all Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 📜 Proposal Pillar
Projects
Status: Done
Development

No branches or pull requests

4 participants