Cannot upvote issue
@markrian has reported that he cannot
:point_left
The error is:
Locking a record with unpersisted changes is not supported. Use `save` to persist the changes, or `reload` to discard them explicitly.
app/models/issue.rb:634:in `update_upvotes_count',
ee/app/models/ee/issue.rb:325:in `update_upvotes_count',
app/models/award_emoji.rb:74:in `expire_cache'
... etc
The following code is causing the problem
def update_upvotes_count
self.lock! 👈 here
self.update_column(:upvotes_count, self.upvotes)
end
- Sentry: https://sentry.gitlab.net/gitlab/gitlabcom/issues/4057762/?referrer=slack
- Kibana: https://log.gprd.gitlab.net/goto/0cdbe820-71ae-11ed-9f43-e3784d7fe3ca
Workaround
The workaround seems to be to edit and save the issue, but this is only available to users who have sufficient privileges:
- Guest users can award an emoji
- Reporter users, + Guest users who are also assignees/authors of non-incident issues
So this workaround won't work for non-assignee/non-author Guest users since they can't update an issue.
Edited by charlie ablett