Weird behavior in Webhook events

Hello!

While testing out the webhooks, I encountered a strange sequence of events.

Instead of the normal happy path where I get the ff. events in order: package_delivering → courier_arriving (dropoff) → courier_waiting (dropoff) → package_delivered

I got this instead: package_deliveringcourier_arriving (pickup)courier_arriving (dropoff)package_deliveringcourier_waiting (dropoff)package_delivered

I registered an endpoint on the sandbox portal and the endpoint runs on my local machine exposed using ngrok. I initially thought it could be just a network related issue, but I could be wrong since the timestamp on each webhook response is in order.

I would love to hear from you about this. Thanks!

Hello @ian.salazar,

Thank you for sharing these details, we are looking into the example on our side and will come back to you.

In the meantime, could you confirm whether you have experienced this issue more than once?

Hello @ian.salazar,

To provide an update, we have found a bug which seems to be causing the behaviour you are experiencing. We are working on the fix and will update you here of any updates.

Thank you again for raising the issue here, and we apologise for the inconvenience of the issue.

Hey, @Lauren! Thanks for looking into this.

I encountered this issue twice, but when I encountered it for the first time, I was not able to save the JSON response I got back via webhook.

But I can describe the first time it happened: the status of a delivery changed from courier_arriving (pickup) → courier_arriving (dropoff) → courier_arrived (pickup) → courier_arrived (dropoff) → package_delivering → package_delivered

Again, I really appreciate your team’s effort looking into this.

Let me know if there’s any update. Thanks!

Ian

1 Like

Hello Ian,

Thank you for the extra details.

We’re actively working on resolving the issue. Although we don’t have an exact timeline right now, I’d like to mention it has a high priority for us and you can rest assured that we’ll keep you posted on our progress.

Should you have any questions or comments in the meantime, please let us know.

Hi @ian.salazar,

Thank you for your patience, we have identified and resolved the issue with the ‘package_delivering’ webhook events being duplicated.

In regards to the ‘courier_arriving’ webhook events, I was hoping you could verify the ‘occurred_at’ time stamp of each webhook to confirm this was indeed sent in the wrong order and is not a retry mechanism issue?

Hello, @Daniel !

I can confirm it was sent in the wrong order, i inspected the order of which my webhook received each payload, and it’s courier arriving + pickup → courier arriving + dropoff → package delivering → courier waiting + dropoff

Although, I reviewed the timestamps of the events courier arriving + pickup → courier arriving + dropoff, and both of them have the same timestamp (2023-12-06T06:44:04.918+01:00)

Hi @ian.salazar,

Thanks for this information I will feed this back internally.
Further on this topic, do you have a retry mechanism in place to force the retry of the webhook send?

@Daniel

Further on this topic, do you have a retry mechanism in place to force the retry of the webhook send?

No, I don’t have a retry mechanism.

Hi @ian.salazar,

Thank you for confirming.
We are looking further into this matter and I will come back to you with an update.

Got it. Thanks, @Daniel !

Hi @ian.salazar,

I can confirm we have applied changes to our V3 webhooks to resolve this fault since our last message before the holidays and after testing this now looks to be correct.

Can you please confirm if you have been experiencing the expected behaviour from our webhooks now or if this issue has persisted?

1 Like

Hey, @Daniel!

The unexpected behavior was fixed, but somehow it skipped some status

I just received the ff. sequence of events: Arriving at pickup → waiting at pickup → package delivering → package delivered

It skipped the statuses arriving at drop off and waiting at drop off

Let me know if this was expected. Thanks!

Hi @ian.salazar,

Do you mind sharing the package ID of the order in question & I will take a look.

Hey, @Daniel !

Here’s the Package ID: 100740126

Let me know how it goes. Thanks!

Hi @ian.salazar,

I can see in this particular job it was not sent due to our sandbox bot courier completing the dropoff tasks early.

I have tested this myself and was not able to replicate the issue and received the “courier_waiting” & “courier_arriving” webhooks for the dropoff task.

May I suggest to also increase the distance in the addresses used for your sandbox jobs as the courier may already be in the dropoff geofence due to the close proximity of your current pickup & drop locations which is why these statuses are skipped.

@ian.salazar,

To add to my point, I would like to refer to the v3 webhook key in our API docs which specifies the “courier_waiting” & “courier_arriving” webhooks are optional events.

I hope this helps & we look forward to your continued testing.

1 Like

Got it @Daniel

That explains it. This is good for now. Thanks!

Regards,
Ian