Skip to content

Overhaul the poll system - #6751

Merged
BurntimeX merged 19 commits into
6.3from
63-poll-overhaul
Oct 25, 2026
Merged

BurntimeX merged 19 commits into
6.3from
63-poll-overhaul

Conversation

@BurntimeX

Copy link
Copy Markdown
Member

Closes #6481
Closes #5925

@BurntimeX
BurntimeX merged commit 86596d2 into 6.3 Oct 25, 2026
9 checks passed
@BurntimeX
BurntimeX deleted the 63-poll-overhaul branch October 25, 2026 12:06
$addedOptionIDs = \array_values(\array_diff($this->optionIDs, $previousOptionIDs));
$removedOptionIDs = \array_values(\array_diff($previousOptionIDs, $this->optionIDs));

WCF::getDB()->beginTransaction();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this transaction doesn't guarantee proper idempotency, because the SELECT is not part of the transaction.

In case of a duplicated request, the INSERT IGNORE will ignore the duplicate, but the UPDATE to update the vote counts will run twice.

I think either the SELECT needs to go into the transaction with FOR UPDATE, or getAffectedRows() needs to be used.

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