-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Include OriginalAuthor in Reaction constraint #13505
Include OriginalAuthor in Reaction constraint #13505
Conversation
When migrating repositories with reactions with deleted users, the original author id may be -1. This means that it is possible to end up attempting to create multiple reactions with the same [ Type, IssueID, CommentID, UserID, OriginalAuthorID ] thus breaking the constraints. On SQLite this appears to cause a deadlock but on other dbs this will cause the migration to fail. This PR extends the constraint to include the original author username in the constraint. Fix go-gitea#13271 Signed-off-by: Andrew Thornton <[email protected]>
ok migration cant be backported ... I'll file a pull to drop entrys from API witch wont have any chance to get migrated to an existing user somehow |
The backport would just have to drop the reactions if they have originalauthorid -1 I think |
admittedly such a backport would not be a backport just an alternate fix but it's the only solution. |
Signed-off-by: Andrew Thornton <[email protected]>
…' of github.com:zeripath/gitea into fix-13271-move-original-author-into-reaction-constraint
damn recreateTable has to be in a transaction for MSSQL - just put it in one |
Codecov Report
@@ Coverage Diff @@
## master #13505 +/- ##
==========================================
- Coverage 42.21% 42.16% -0.06%
==========================================
Files 694 695 +1
Lines 76351 76368 +17
==========================================
- Hits 32231 32199 -32
- Misses 38848 38886 +38
- Partials 5272 5283 +11
Continue to review full report at Codecov.
|
potential issue from this -> #13588 |
No this is not the cause of your issue. |
When migrating repositories with reactions with deleted users, the original
author id may be -1. This means that it is possible to end up attempting
to create multiple reactions with the same [ Type, IssueID, CommentID, UserID,
OriginalAuthorID ] thus breaking the constraints.
On SQLite this appears to cause a deadlock but on other dbs this will
cause the migration to fail.
This PR extends the constraint to include the original author username
in the constraint.
Fix #13271
Signed-off-by: Andrew Thornton [email protected]