New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix duplicated endorsements #11853
Fix duplicated endorsements #11853
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it locally and it seems like it fixed this problem.
I think we should add a rake task with a comment in the RELEASES_NOTES to fix the (possible) cases where there's more than one endorsement. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's preventing the issue with the more than one endorsement with the same user in the same resource, so on that side 🆗
Regarding the rake task, I think it's messing with the functionality, as it isn't allowing me to "Unlike" after I've liked:
And when I click in my username in the modal, I see that the server is responding with 422 errors.
What I would expect is to see the "green"/selected identity in that modal, and then to be able to "unlike" it (and like it again).
Can you check that out please?
decidim-core/lib/tasks/upgrade/decidim_deduplicate_endorsements.rake
Outdated
Show resolved
Hide resolved
decidim-core/lib/tasks/upgrade/decidim_deduplicate_endorsements.rake
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
@andreslucena I have checked this, and I could not find anything wrong with it. There caching issue.
Can you check that is not the same case on your end? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽
Only failing check is Codecov as usual, so I'm merging this |
🎩 What? Why?
This PR tries to fix a concurrency issue that happens in endorsements. As per PostgreSQL documentation, null values in a unique column are not considered equal, allowing multiple nulls in the column.
Testing
bundle exec rails decidim:upgrade:fix_duplicate_endorsements