Retry mechanism and how are multiple device tokens handled?
Hello all,
We are still in the process of rolling out our apps push & web push notifications through novu. However I ran into something a little confusing/concerning and would love to get some clarity.
1. I have a subscriber which when I query for thier FCM device tokens I see there is currently two (both in the same FCM object in in the deviceTokens array). When I send a notification to this subscriber I only see it sending to one of the device tokens (looks like the first one in the array). Is this expected? And if so how am I meant to add new device tokens which receive notifications?
2. I also noticed that there doesn't seem to be any retries when FCM returns the errors I have seen so far like ""Sending message failed due to "Requested entity was not found.""" errors. Is there any exponential backoff or retry mechanism in place as it stands? (I hope so 🤞)
8 Replies
1. We try to send with all the tokens, but only valid tokens, it is successful
2. Currently, we don't have retry mechanism
Re 1: So I am curious why in this situation we are only sending the one failing (stale) token and not the others? Is there something I am doing wrong or something in the logic trying to send it. How can I help debug this
Re 2: I see in 2023 there was a ticket to discuss/implement this. Is it on the roadmap? Is there any way you have heard of people implementing this themselvs?
Is there something I am doing wrong or something in the logic trying to send it.How can I help debug thisCould you please share the transactionId from the activity feed page? I will check the issue from our side
Is there any way you have heard of people implementing this themselvs?We support sdk level retry option, so if you trigger a workflow and it fails due to some error, it will retry. But for step level retry is not possible currently.
txn_68c7e98c5gen3rdiaf4a -- Note: I have manually cleared the device tokens to only have one for the subscriber so not sure if that makes it harder for you to debug. But at the time of sending this notification they had 3 tokens
We support sdk level retry option, so if you trigger a workflow and it fails due to some error, it will retry. But for step level retry is not possible currently.Hmm, so if my workflow is just sending a push notification and that fails, woudl that workflow retry?
my workflow is just sending a push notification and that fails, woudl that workflow retry?No, it will not retry, since it is a step-level (push step) failure
Okay understood, and what would count as a workflow failure that would trigger a retry? Is there a doc on this mechanism?
Also curious what comes out of that notification issue, thank you for looking into it
what would count as a workflow failure that would trigger a retryworklfow trigger can be failed, due to 5xx erros and 4xx errors like invalid worklfowId, invalid payload schema. Currenlty we don't have a doc on this. I am creating an internal ticket for the same
what comes out of that notification issue,It's a bit tricky to debug this as in above transactionId, the same device token is used that subscriber currently has and now subscriber has already been updated
Understood, 5xx 4xx's make sense, thank you for creating a doc for this. But I would guess that a 4xx or 5xx from firebase wouldn't qualify?
It's a bit tricky to debug this as in above transactionIdUnderstood, I will try to keep an eye out for it in testing and raise it up as soon as possible