Poll: Missing Handling for Signaling Errors

Summary

Currently, incoming poll-related signaling errors are ignored by the frontend. This leads to a broken UX where moderators are redirected out of the "Create Poll" form to the overview page without any feedback when a backend validation fails (e.g., topic too long or a poll is already running).

Expected behavior

  1. The user should remain on the form so they can correct their input
  2. A descriptive, localized error toast should appear

Steps to reproduce the bug

Invalid Topic Length

  1. Join as a moderator and navigate to Polls > Create new Poll
  2. Enter a topic exceeding 100 characters
  3. Click Start
  4. Notice: User is kicked back to the polls overview - no error is shown

Concurrent Poll Conflict (still_running)

  1. Start a valid poll.
  2. Attempt to start a second poll simultaneously
  3. Notice: The UI fails silently and redirects

interface

limits enforced by the backend:

  • duration: 60min
  • topic length: 100 chars
  • max choices/options: 64
  • choice/option length: 100 chars
export enum PollError {
  InsufficientPermissions = 'insufficient_permissions',
  InvalidChoiceCount = 'invalid_choice_count',
  InvalidPollId = 'invalid_poll_id',
  InvalidChoiceId = 'invalid_choice_id',
  InvalidDuration = 'invalid_duration',
  VotedAlready = 'voted_already',
  StillRunning = 'still_running',
}

translations

english

poll-error-insufficient-permissions = You do not have permission to perform this action.
poll-error-invalid-choice-count = Invalid number of choices provided.
poll-error-invalid-poll-id = The requested poll could not be found.
poll-error-invalid-choice-id = The selected answer is invalid.
poll-error-invalid-duration = The specified poll duration is invalid.
poll-error-voted-already = You have already voted in this poll.
poll-error-still-running = This action cannot be performed while the poll is still running.

german

poll-error-insufficient-permissions = Sie haben keine Berechtigung für diese Aktion.
poll-error-invalid-choice-count = Ungültige Anzahl an Antwortmöglichkeiten.
poll-error-invalid-poll-id = Die angefragte Umfrage konnte nicht gefunden werden.
poll-error-invalid-choice-id = Die ausgewählte Antwort ist ungültig.
poll-error-invalid-duration = Die angegebene Dauer der Umfrage ist ungültig.
poll-error-voted-already = Sie haben bereits an dieser Umfrage teilgenommen.
poll-error-still-running = Diese Aktion kann nicht ausgeführt werden, solange die Umfrage noch läuft.

Acceptance Criteria

  • map backend errors to error toasts
  • do not redirect the user away from the creation form if a signaling error is received

Logs and/or screenshots

Edited by Maximilian Fuß