Skip to content

Fix empty poll options not being filtered on remote poll update#12484

Merged
Gargron merged 1 commit intomastodon:masterfrom
ClearlyClaire:fixes/update-invalid-poll
Nov 26, 2019
Merged

Fix empty poll options not being filtered on remote poll update#12484
Gargron merged 1 commit intomastodon:masterfrom
ClearlyClaire:fixes/update-invalid-poll

Conversation

@ClearlyClaire
Copy link
Copy Markdown
Contributor

If a poll contains empty options (which is apparently possible on Pleroma),
it is created without them. However, the poll update code doesn't filter
empty options, and thus:

  1. Clear known votes, as it assumes the set of options has changed
  2. Errors out because it tries adding empty options, which fails validation

This commit fixes that by filtering them out the same way they are filtered
out at poll creation time.

If a poll contains empty options (which is apparently possible on Pleroma),
it is created without them. However, the poll update code doesn't filter
empty options, and thus:
1. Clear known votes, as it assumes the set of options has changed
2. Errors out because it tries adding empty options, which fails validation

This commit fixes that by filtering them out the same way they are filtered
out at poll creation time.
@Gargron Gargron merged commit 00c219a into mastodon:master Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants