Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What change does this PR introduce?
Add default value for apns
production
option. Undefined value leads to unexpected behaviour.Why was this change needed?
Closes #3416 - everything is well described in this issue
https://github.com/node-apn/node-apn#connecting
Basically when user creates APNs integration, by default it creates credentials where
secure
is optional field so it's undefined when value not specified (secure
field is used forproduction
option fornode-apn
). So whensecure
is undefined, thennode-apn
package usesNODE_ENV
to determine if production is true or false. It may lead to scenario where user has production set to undefined (in GUI it's switch which indicates that production should be disabled) but Novu servers are probably running withNODE_ENV=production
and then we have bug or at least possible unexpected behaviour.Important note - this PR is very closely related to PR#3430. 3430 solves other problem where
secure
used forproduction
field is persisted as string, so if someone provides "false" then it's interpreted bynode-apn
as true value what makes whole provider just broken actually.Other information (Screenshots)