Solved

Two Events Webhooks Sent with Same Timestamp

  • 13 September 2021
  • 1 reply
  • 64 views

Badge +2

We were recently testing our RevenueCat integration in the Google Play Store sandbox and had a user that was stuck in a terminal Active state even though their account had been cancelled on the Google Play Store side.

It turned out that what happened was that the user started their subscription at 8:00 PM and then cancelled at 8:23 PM. 

Had their subscription of  monthly_plan cancelled due to a billing error

2021-09-07 8:23 PM

Started a subscription of  monthly_plan

2021-09-07 8:00 PM

The only problem was that the webhook for both of these events were sent at 8:23 PM and had the exact same ms timestamp for their `event_timestamp_ms` so we had no way to determine which happened first.

My main questions are:

  1. Is this related to the fact that these were sandbox events? Are sandbox events not guaranteed to go out when the event happens?
  2. Even if this is related to them being sandbox events, is there a way to differentiate which event was applied first?
icon

Best answer by ryan 14 September 2021, 20:15

View original

1 reply

Userlevel 5
Badge +9

Generally the event timestamp should be considered informational and you typically wouldn’t be relying on it to grant or remove entitlement access on your server. Events may be delayed, and there are cases where multiple events will be dispatched simultaneously. 

For purchases/renewals, the most important dates there are the expiration_date, and the purchase date. Those will tell you when the purchase actually happened and when you need to remove access for the customer.

For cancellation events, they don’t contain a time where the customer actually cancelled or unsubscribed, so the event timestamp is a good estimation of this. However you should still inspect the expiration_date to determine when access would be removed. 

Reply