hicommonwealth / commonwealth

A platform for decentralized communities
https://commonwealth.im
GNU General Public License v3.0
68 stars 44 forks source link

unable to vote on thread poll #9986

Closed markiscommon closed 13 hours ago

markiscommon commented 1 day ago

Describe the bug

when trying to vote on a thread poll an error shows up

Initial conditions

Environment: prod Branch/Release version: latest Browser: chrome Wallet: mm

Reproduction steps

try to vote on a poll https://commonwealth.im/vita-fast/discussion/25732-vfdp12-approval-to-test-vitafast-compounds-for-life-extension-in-worms

Actual behavior

unable to vote, error pops up

Expected behavior

should execute the vote

Screenshots / Video

image

image

Reporter

VitaDAO

Additional context

P1

ilijabojanovic commented 1 day ago

Here is rollbar data: https://app.rollbar.com/a/commonwealth/fix/item/Commonwealth/9666

ilijabojanovic commented 1 day ago
[21:57:57.913] ERROR (setupErrorHandlers.ts): Could not verify user token balance {"url":"/api/polls/1661/votes","method":"PUT","headers":{"host":"localhost:3000","referer":"http://localhost:8080/vita-fast/discussion/25732-vfdp12-approval-to-test-vitafast-compounds-for-life-extension-in-worms"},"user":{"id":131052},"status":500}
    err: {
      "type": "ServerError",
      "message": "Could not verify user token balance",
      "stack":
          ServerError: Could not verify user token balance
              at ServerPollsController.__updatePollVote (/Users/ilijabojanovic/Documents/work/common/commonwealth/packages/commonwealth/server/controllers/server_polls_methods/update_poll_vote.ts:83:11)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at updatePollVoteHandler (/Users/ilijabojanovic/Documents/work/common/commonwealth/packages/commonwealth/server/routes/polls/update_poll_vote_handler.ts:24:36)
      "status": 500,
      "error": {
        "type": "AppError",
        "message": "Insufficient token balance",
        "stack":
            AppError: Insufficient token balance
                at ServerPollsController.__updatePollVote (/Users/ilijabojanovic/Documents/work/common/commonwealth/packages/commonwealth/server/controllers/server_polls_methods/update_poll_vote.ts:80:13)
                at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                at updatePollVoteHandler (/Users/ilijabojanovic/Documents/work/common/commonwealth/packages/commonwealth/server/routes/polls/update_poll_vote_handler.ts:24:36)
        "status": 400,
        "name": "AppError"
      },
      "name": "ServerError"
    }
timolegros commented 1 day ago

Implemented a temporary fix for the vita-fast community by adding the UPDATE_POLL permission to the GroupPermissions.allowed_actions array of group id 360.

Working on a longer-term fix which includes: