mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 05:07:22 +01:00
Establish lock to avoid race scenario in subscriptions (#14267)
* fix(subscription): establish lock to avoid race scenario * fix(lint): import syntax * fix(lint): whitespace, dependency cycle * fix(subs): skip locking on gifts and groups * fix(subs): correctly reset _subSignature * fix(sub): use findOneAndUpdate for unlock * fix(test): save newly created user for some reason Co-authored-by: SabreCat <sabe@habitica.com>
This commit is contained in:
@@ -326,6 +326,7 @@ describe('Apple Payments', () => {
|
||||
it('errors when a user is already subscribed', async () => {
|
||||
payments.createSubscription.restore();
|
||||
user = new User();
|
||||
await user.save();
|
||||
|
||||
await applePayments.subscribe(sku, user, receipt, headers, nextPaymentProcessing);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user