From a9d5e8aeec8be599d8e6e1865e86bdfb8cf3d7f0 Mon Sep 17 00:00:00 2001 From: Pierre Lehnen Date: Wed, 19 Aug 2020 15:09:52 -0300 Subject: [PATCH 1/2] Stop trying to resend push notification when the gateway response was a 422 error --- app/push/server/push.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/push/server/push.js b/app/push/server/push.js index 44e4e6461c67..6614da64f03e 100644 --- a/app/push/server/push.js +++ b/app/push/server/push.js @@ -132,6 +132,11 @@ export class PushClass { return; } + if (response?.statusCode === 422) { + logger.info('gateway rejected push notification. not retrying.'); + return; + } + logger.error(`Error sending push to gateway (${ tries } try) ->`, error); if (tries <= 4) { From e503af53bea3d76402fdd95f6356bf2c4aa9fe8b Mon Sep 17 00:00:00 2001 From: Pierre Lehnen Date: Mon, 24 Aug 2020 12:46:57 -0300 Subject: [PATCH 2/2] Moved condition up --- app/push/server/push.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/push/server/push.js b/app/push/server/push.js index 6614da64f03e..f3a01b1fc9bb 100644 --- a/app/push/server/push.js +++ b/app/push/server/push.js @@ -128,12 +128,12 @@ export class PushClass { return; } - if (!error) { + if (response?.statusCode === 422) { + logger.info('gateway rejected push notification. not retrying.'); return; } - if (response?.statusCode === 422) { - logger.info('gateway rejected push notification. not retrying.'); + if (!error) { return; }