Habitica: {err:Cannot read property 'purchased' of null}

Created on 16 Dec 2014  路  10Comments  路  Source: HabitRPG/habitica

A few users have reported an error when subscribing via Paypal: "{err:Cannot read property 'purchased' of null}". The subscription is setup properly on Paypal (they're charged), but the error prevents the details from being saved to their account. I'm able to verify the txn and map the details fine, but this needs fix'n

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

All 10 comments

What is the status on this?

We do still get occasional reports of people attempting to subscribe, getting charged, but not receiving subscription benefits on the Habitica end. The specific error message doesn't sound familiar, though.

I believe this happens when Paypal sends a cancel notice, our webhook doesn't work correctly, and then someone tries to cancel via our Paypal route, but it is already canceled on the Paypal side, so we get an error http response from the API.

@TheHollidayInn: That might happen (it certainly does with Stripe, which has no Webhook handling at all yet), but if so, that's a different issue--this issue as reported happens at time of subscription, not cancellation.

We always assume success, so we need to code and write tests for the following: https://developer.paypal.com/docs/api/errors/

We will use this PR: #8690 to determine if this problem still exists.

Hi, can I tackle this issue?

We don't have a reliable way to reproduce this. It seems to be caused by corruption during the subscription process. I have a third-party logging set up to discover this. I would suggest a different issue for now.

Is this still an issue?

I haven't seen it on our log system. So, I'd say no.

Was this page helpful?
0 / 5 - 0 ratings