nat
(Natalie T)
6월 14, 2023, 11:16오전
10
이건 꽤 재밌는 버그입니다.
투표 결과가 제대로 병합되지 않는 문제 때문에, Lancelot(id 383) → Galahad(id 120)로 병합할 경우 Lancelot은 실제로 존재하게 되지만 기본 이메일이 없게 됩니다. /admin/users/383/lancelot은 익명화 검사로 인해 http 500 오류가 발생했습니다.
어쨌든 수정 작업이 진행 중입니다. 중복되는 경우 이 경우에는 Galahad(대상 사용자)의 투표를 유지하는 쪽으로 결정했습니다.
main ← user-merger-email-empty
merged 11:19AM - 14 Jun 23 UTC
This is somewhat of an uncommon case where if a plugin fails to merge a user, th… e merge would fail but the `user_email` of the `source_user` would have been transferred to the `target_user`. This leaves the `source_user` without an email, and this bug would occur when admins try to access `/admin/users/<id>/<username>`.
This allows the admin to continue dealing with the user.
https://meta.discourse.org/t/error-merging-users-with-duplicate-poll-votes/154711
A consideration here would be to use a transaction (probably very costly), or reorder the order of events in `UserMerger.merge!`
main ← de-duplicate-poll-vote-user-merge
merged 03:18AM - 15 Jun 23 UTC
Currently when merging users, polls may error out if the source and target users… have both voted on the same poll before. 😢
There is currently 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
<img width="450" alt="Screenshot 2023-06-14 at 7 12 06 PM" src="https://github.com/discourse/discourse/assets/1555215/19d9ed06-2206-45f5-826f-e1c565f01bab">
Related: https://github.com/discourse/discourse/pull/22105
4개의 좋아요