Restoring Purchases from Different App User ID, Duplicate Entitlements
jswilliams opened this issue · 7 comments
Hey all,
I think I may have found an issue with restoring purchases.
We have our restore behavior set to "Transfer"
If we restore purchases while logged in as a different app user id then a new document is put into the customers collection for that app user id and it has the entitlement, this seems to be what I'd expect.
But the customer document for the previous app user id still has that same entitlement in Firestore. Shouldn't the transfer behavior make it so the source user's document has the entitlement taken away since the destination user now has it? As it is right now both customers still have the entitlement in Firestore.
Thanks,
Justin
Hi @jswilliams , thanks for reaching out. Seems like there's an issue there. I have logged a ticket internally to look at this as soon as possible and will get back to you when it's fixed.
Hey @alfondotnet, thanks.
Wondering if there's any update on this so far.
We're thinking we should wait to release our subscription feature until this is fixed, we're worried about ending up with prod Firestore data that's out of sync compared to what is in RevenueCat, certain user accounts could end up with with having our Premium entitlement permanently (at least as far as Firestore account data is concerned) when using restore purchases.
On a somewhat similar note, is if there are any future plans for some sort of script to be made available that we can run to occasionally sync/back load RevenueCat data to Firestore in case of things like outages/transient errors/etc.
@jswilliams Thanks for the heads up, I am moving this internally to try to slip this work in this week, although it might bleed onto next week. Hope that works for you.
is if there are any future plans for some sort of script to be made available that we can run to occasionally sync/back load RevenueCat data to Firestore in case of things like outages/transient errors/etc.
Good question, we have in the past re-sent events (that happened after the Firebase integration was set up), although it has been a manual process. No plans yet on anything automatic, although I'll pass the feedback internally
That'll be great. Appreciate you all looking into it
@jswilliams touching base on it, I have hit some roadblocks on this as I need to modify the structure of our backend event to be able to solve this issue reliably. I am working on it and will provide an ETA shortly. Sorry for keeping you waiting on this.
@alfondotnet sounds good, appreciate it!
@jswilliams just published 0.1.5 which addresses this issue. Transfer events will now correctly update the origin customer collection removing the entitlements and subscriptions as expected. Sorry for the inconveniences.