discourse/plugins/poll/spec
Natalie Tay fcaefc9f2f
FIX: De-duplicate poll vote on user merge (#22107)
When merging users, polls may error out if the source and target users have both voted on the same poll before. 😢 

There is no constraint on the `poll_votes` table either to support this. Ideally a composite primary key can be used `(poll_id, user_id)`, but alas there is no support yet, which is probably why it wasn't created in the first place.

This fix ensures that merging is successful by only keeping the target poll votes if duplicates exist.

This fix also runs a migration on older poll votes where failed merges would have caused a single user to have voted twice on a single poll. e.g. this weird edge case
2023-06-15 11:18:51 +08:00
..
controllers DEV: Apply syntax_tree formatting to plugins/* 2023-01-07 11:11:37 +00:00
fabricators FIX: De-duplicate poll vote on user merge (#22107) 2023-06-15 11:18:51 +08:00
integration FIX: De-duplicate poll vote on user merge (#22107) 2023-06-15 11:18:51 +08:00
jobs/regular DEV: Apply syntax_tree formatting to plugins/* 2023-01-07 11:11:37 +00:00
lib FEATURE: Add in:polls filter to search (#19885) 2023-01-18 14:55:20 -05:00
models DEV: Apply syntax_tree formatting to plugins/* 2023-01-07 11:11:37 +00:00
requests FIX: Ensure poll extraction is not attempted if post body is absent (#19718) 2023-01-13 01:47:44 +00:00
serializers DEV: Apply syntax_tree formatting to plugins/* 2023-01-07 11:11:37 +00:00