Editing a topic to add a Poll crashes Discourse!

AI-generated summary

A user, Yassine_Yousfi, reported that adding a poll to an existing topic via admin edit caused Discourse to freeze and Chrome to crash due to memory exhaustion. The issue was traced to using a float value (e.g., step=0.5) in a number-type poll, which caused the Poll plugin to fail silently and discard all post changes. zogstrip and mikechristopher initially couldn’t replicate the issue and asked for logs and plugin details. Yassine_Yousfi confirmed the crash occurred only with float step values, even in this forum. zogstrip tested it and found it working, suggesting possible environment-specific behavior. jomaxro confirmed it didn’t crash on topics either, linking to a test on try.discourse.org. Yassine_Yousfi later resolved the issue after rebuilding the app due to an SSL problem and updating Discourse — the error no longer occurred. The thread concludes with gratitude for the quick community support. The issue appears to have been environment-specific or resolved by updating the software.

So it goes like this:

  1. User A: Creates an ordinary topic.

  2. Admin: Comes in to edit the topic by adding a Poll object to it.

  3. Discourse: Freezes for ever, immediately after adding the poll.

  4. Chrome: Eats all the memory there is to eat before suicide.

  5. End result:


EDIT: by an admin adding a poll :bar_chart:

  • :banana:
  • :apple:
  • :lemon:
0 voters

Works fine here…

Do you know what poll the admin tried to add?
Do you know if there are any non-official plugins installed?

I cannot replicate it in my test environment.

Is there anything in your logs?

@mikechristopher @zogstrip

Found the issue it’s certainly a bug or limitation.

So the Poll plugin crashes without any warning and all Post changes are lost, if you try to add any float numbers to the numbers poll.

Like:

 [poll type=number min=1 max=20 step=0.5 public=true]
[/poll]

It only crashes if step is float number! even in this forum too, can be replicated.

Let’s try it

[poll type=number min=1 max=20 step=0.5 public=true]
[/poll]
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
0 voters

@Yassine_Yousfi seems to be working here just fine…

Awkward!

It used to break! could it be breaking only on topics (first post) not in all posts!

Also noticed that in this discourse, it shows minimum step being 1, on mine not. and it broke for me when i was writing the topic as well!

Doesn’t crash on topics either. See https://try.discourse.org/t/testing-polls-with-float-steps/1030 (note that try resets daily so it won’t be there forever.

Somehow my discourse doesn’t auto update anymore, not even from the admin side! but it had an SSL issue and had to rebuild the app from ssh again. and now i got latest update!
And the error doesn’t seem to occur anymore :slight_smile:

Thank you for your prompt replies guys!

Best