Files
habitica/website/server/controllers/api-v3
Aleksandr Saitgalin 1823f658c6 update user and group in a transaction when creating a group. fixes #12124 (#13730)
* fix #12124

add a transaction for updating user and group
so the user doesn't lose gems when saving the group fails

* use mongoose transaction helper

use the helper instead of manually commiting/aborting
to deal with transient transaction errors

* increase timeout and add console.log outputs

add some logging to a failing test

* Revert "increase timeout and add console.log outputs"

This reverts commit 0c36aaa55f.

* add a test for gems when guild creation fails

test the transaction in createGroup()
make sure user keeps the gems if group.save() rejects

* fix(test): try suggested delay from PR discussion

Co-authored-by: SabreCat <sabe@habitica.com>
2022-04-29 16:47:17 -05:00
..
2020-02-12 15:40:44 -05:00
2021-11-24 11:51:00 -06:00
2019-10-08 16:57:10 +02:00
2019-10-08 16:57:10 +02:00
2019-10-11 13:03:05 +02:00
2020-10-13 10:15:52 -05:00
2020-03-01 20:53:33 +01:00
2019-10-13 18:31:43 +02:00
2021-11-04 16:33:08 -05:00
2020-07-01 18:20:18 +02:00
2021-03-23 11:58:21 -05:00