You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.
If users double-click on submit in the user badge form, they may create user (and probably others too) badge assignments multiple times. Afterwards this badge can't be deleted anymore, as SQLAlchemy will then complain:
WebApp Error: <class 'sqlalchemy.orm.exc.StaleDataError'>: DELETE statement on table 'user_badges' expected to delete 1 row(s); Only 3 were matched.
How to fix? Possibilities:
Not allow double clicks through Javascript. This is useful in other submits as well (comments etc.). It doesn't prevent that issue from happening if users want to force it.
Add UNIQUE constraints to the xx_badges tables. This avoids that multiple processes add badges concurrently.
Deal with it, i.e. accept that badges exist multiple times. Make sure all of them are deleted when they're supposed to. This might not be easily possible without changing the ORM configuration.
If (3) isn't realized, the existing problems need to be fixed on database level manually.
The text was updated successfully, but these errors were encountered:
If users double-click on submit in the user badge form, they may create user (and probably others too) badge assignments multiple times. Afterwards this badge can't be deleted anymore, as SQLAlchemy will then complain:
How to fix? Possibilities:
xx_badges
tables. This avoids that multiple processes add badges concurrently.If (3) isn't realized, the existing problems need to be fixed on database level manually.
The text was updated successfully, but these errors were encountered: