Skip to main content
Solved

Error: Purchase was cancelled (intermittently seen in production)

  • November 1, 2024
  • 3 replies
  • 201 views

Forum|alt.badge.img+6

I’m seeing this error pop up in production only, through Sentry logs. It is intermittent -- it looks like most users are able to subscribe successfully. And, I know that in some cases this may be a legitimate situation where someone clicks purchase and then cancels out of it.

However, I see this happening a lot more than I would expect if it were just that situation. In addition, I have specific reports of users trying to make the purchase and seeing an error message in my app. When I triangulate that back to the Sentry issue occurring on that device at that time, it’s the “Purchase was cancelled” error.

So my question is, if the user is saying they are attempting to purchase and not canceling it, but they are still getting this error back from RC, how can I further debug?

For additional context here is the complete error I get back from RC. Again, this happens intermittently when users attempt to make a purchase, even if they state that they did not cancel it:

{
  code: 1,
  message: Purchase was cancelled.,
  name: Error,
  nativeStackAndroid: [Array],
  stack:
  Error: Purchase was cancelled. at promiseMethodWrapper (address at index.android.bundle:1:169656) at anonymous (address at index.android.bundle:1:807563) at call (native) at step (address at index.android.bundle:1:803639) at anonymous (address at index.android.bundle:1:802746) at fulfilled (address at index.android.bundle:1:802369) at tryCallOne (address at index.android.bundle:1:1401639) at anonymous (address at index.android.bundle:1:1402324) at apply (native) at anonymous (address at index.android.bundle:1:331859) at _callTimer (address at index.android.bundle:1:330858) at _callReactNativeMicrotasksPass (address at index.android.bundle:1:331002) at callReactNativeMicrotasks (address at index.android.bundle:1:332931) at __callReactNativeMicrotasks (address at index.android.bundle:1:151742) at anonymous (address at index.android.bundle:1:150878) at __guard (address at index.android.bundle:1:151616) at flushedQueue (address at index.android.bundle:1:150789) at invokeCallbackAndReturnFlushedQueue (address at index.android.bundle:1:150732)
  ,
  userCancelled: true
}

Thanks so much in advance for any assistance!

Best answer by joan-cardona

Hi @asindhu,

The message `Purchase was cancelled` happens when the user taps on purchase and when the store sheet opens, they close it. It doesn’t mean they cancelled the purchase while it was happening. Here’s the full explanation about the error message.

Do you know the exact message your user got and what was the flow? 

Best,

View original
Did this post help you find an answer to your question?
This post has been closed for comments

3 replies

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 313 replies
  • Answer
  • November 5, 2024

Hi @asindhu,

The message `Purchase was cancelled` happens when the user taps on purchase and when the store sheet opens, they close it. It doesn’t mean they cancelled the purchase while it was happening. Here’s the full explanation about the error message.

Do you know the exact message your user got and what was the flow? 

Best,


Forum|alt.badge.img+6
  • Author
  • Helper
  • 7 replies
  • November 5, 2024

Hi, thanks so much for your response! Got it, that makes sense. So the message that the user gets is more my own internal logic for handling purchase errors. Basically at the moment I don't distinguish between various purchase errors and just show an alert any time I get an RC error saying back to the user that an error occurred and please try again.

I think from what you’re saying basically I need to explicitly carve-out “Purchase cancelled” and not pop up my own error in that case as it will confuse users. What may be happening is that the user taps out and doesn’t realize they exited out of the flow, but then they see my error message, and then they think there’s a problem when in fact they just accidentally exited out.

I’ll start by adding that carve-out and see how it goes. Thanks again for the help.


joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 313 replies
  • November 11, 2024

Hi @asindhu,

Correct! That should work and avoid showing error messages that are not technically an error to your users.

Best,


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings