From e2fd6a72c2585697252a81104ddf210c36bc57d3 Mon Sep 17 00:00:00 2001 From: SabreCat Date: Tue, 21 Dec 2021 16:25:29 -0600 Subject: [PATCH 1/3] fix(test): correct stub restore --- test/api/unit/libs/payments/payments.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/api/unit/libs/payments/payments.test.js b/test/api/unit/libs/payments/payments.test.js index ee052b632b..6083744658 100644 --- a/test/api/unit/libs/payments/payments.test.js +++ b/test/api/unit/libs/payments/payments.test.js @@ -251,7 +251,7 @@ describe('payments/index', () => { }); afterEach(() => { - worldState.getCurrentEvent.restore(); + worldState.getCurrentEventList.restore(); }); it('sends a private message about the gift', async () => { From f2cfc2744d0d34e9f63fb13d87af898ae247c7d4 Mon Sep 17 00:00:00 2001 From: SabreCat Date: Wed, 22 Dec 2021 14:58:15 -0600 Subject: [PATCH 2/3] fix(Slack): improve subscription notif logic --- website/server/libs/payments/subscriptions.js | 1 + website/server/libs/slack.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/website/server/libs/payments/subscriptions.js b/website/server/libs/payments/subscriptions.js index d4016349fe..1a68734680 100644 --- a/website/server/libs/payments/subscriptions.js +++ b/website/server/libs/payments/subscriptions.js @@ -293,6 +293,7 @@ async function createSubscription (data) { paymentMethod: data.paymentMethod, months: group ? 1 : months, groupId, + autoRenews, }); } diff --git a/website/server/libs/slack.js b/website/server/libs/slack.js index a88d624bfd..615c7d4284 100644 --- a/website/server/libs/slack.js +++ b/website/server/libs/slack.js @@ -182,6 +182,7 @@ function sendSubscriptionNotification ({ paymentMethod, months, groupId, + autoRenews, }) { if (SKIP_SUB_METHOD) { return; @@ -194,8 +195,10 @@ function sendSubscriptionNotification ({ text = `${buyer.name} ${buyer.id} ${buyer.email} bought a ${months}-month gift subscription for ${recipient.name} ${recipient.id} ${recipient.email}${promoString} using ${paymentMethod} on ${timestamp}`; } else if (groupId) { text = `${buyer.name} ${buyer.id} ${buyer.email} bought a 1-month recurring group-plan for ${groupId} using ${paymentMethod} on ${timestamp}`; - } else { + } else if (autoRenews) { text = `${buyer.name} ${buyer.id} ${buyer.email} bought a ${months}-month recurring subscription using ${paymentMethod} on ${timestamp}`; + } else { + text = `${buyer.name} ${buyer.id} ${buyer.email} bought a ${months}-month non-recurring subscription using ${paymentMethod} on ${timestamp}`; } subscriptionSlack From 3b8a9d59b1a167658322c29972bc70b332617934 Mon Sep 17 00:00:00 2001 From: SabreCat Date: Wed, 22 Dec 2021 15:00:01 -0600 Subject: [PATCH 3/3] 4.215.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4b750ed263..a1ade8b68e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "habitica", - "version": "4.215.0", + "version": "4.215.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 94f2cf9ecf..c9ed749fa0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "habitica", "description": "A habit tracker app which treats your goals like a Role Playing Game.", - "version": "4.215.0", + "version": "4.215.1", "main": "./website/server/index.js", "dependencies": { "@babel/core": "^7.16.0",