Glench / ExtPay

The JavaScript library for ExtensionPay.com — payments for your browser extensions, no server needed.
https://extensionpay.com
Other
524 stars 66 forks source link

user.subscriptionStatus disappears when you have more than one version of your extension, and it stays disappeared. #145

Closed philipmulcahy closed 1 year ago

philipmulcahy commented 1 year ago

Describe the bug ExtPay's user.subscriptionStatus goes awol when you install a local version of the extension on a user's machine, and removing the additional copy doesn't seem to fix things.

To Reproduce Install extension that uses ExtPay subscriptions. Subscribe All is good Install a local copy of the extension (such as a test build provided for UAT/feedback purposes) paid-for features are disabled, even though the ExtPay UI claims you have paid. Debugging of extension shows that user.subscriptionStatus has disappeared, while user.paid is still true (see debugger screenshot including console dump of a user object). Uninstall the local copy doesn't help Reinstalling the store copy doesn't help either.

Expected behavior ExtPay should work on both copies (perhaps with login workflow) Different extension installs should not interfere with each other.

Screenshots

Screenshot 2023-06-18 at 16 04 44

Desktop

Additional context I've changed my predicate from user.subscriptionStatus == 'active' to user.paid, which seems to work for now, so not necessarily urgent. It'd be useful to have a work-around in your API that zaps ExtPay's locally stored state - I already have a logout button for other (non ExtPay) login-state, and calling such an ExtPay function would not make my UI more complicated.

philipmulcahy commented 1 year ago

from my extension's popup, I tried:

['extensionpay_api_key', 'extensionpay_installed_at', 'extensionpay_user'].forEach(k => chrome.storage.sync.remove(k))

on a browser login that's paid up as a normal user, and then logged in again and took a look at sync storage:

"key": "extensionpay_user",
"value": "{\"email\":\"XXX@gmail.com\",\"installedAt\":\"2023-06-18T20:42:35.479Z\",\"paid\":true,\"paidAt\":\"2023-06-18T20:43:13.309Z\",\"trialStartedAt\":null}"

This ^ looks the same (no subscription info) as it did before zapping the entries.

On a "healthy" deployment (one that has not gone through the parallel installation and/or reinstallation), I see this:

"key": "extensionpay_user",
"value": "{\"email\":\"YYY.org\",\"installedAt\":\"2023-06-02T17:17:22.630Z\",\"paid\":true,\"paidAt\":\"2023-06-04T19:57:15.861Z\",\"subscriptionCancelAt\":null,\"subscriptionStatus\":\"active\",\"trialStartedAt\":null}"
philipmulcahy commented 1 year ago

a quick search of this repo suggests that the code that sets subscriptionStatus is not shared, so I think the ball's in your court

mpienkowski commented 1 year ago

@Glench I confirm the issue. I've got a local (and only) installation of my extension and recently, in user object I'm getting no subscriptionStatus property, even though paid is true.

Maybe Chrome update is to be blamed?

philipmulcahy commented 1 year ago

I’ve not dug at the extpay open source code too hard, but am speculating that the problem is server side.

On 20 Jun 2023, at 19:29, Maciej Pieńkowski @.***> wrote:

@Glench https://github.com/Glench I confirm the issue. I've got a local (and only) installation of my extension and recently, in user object I'm getting no subscriptionStatus property, even though paid is true.

Maybe Chrome update is to be blamed?

— Reply to this email directly, view it on GitHub https://github.com/Glench/ExtPay/issues/145#issuecomment-1599298283, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMXOHEKUTBF6F6YEQECLTLXMHTW7ANCNFSM6AAAAAAZK77VPU. You are receiving this because you authored the thread.

Glench commented 1 year ago

I haven't been able to look more deeply into this yet, but no data is shared between extensions in the user's browser.

In your reproduction steps, you didn't say whether you used your developer credentials to activate the extension or your paid "login" credentials that you used when paying in your production-version extension. Could you please share what you did in your local extension version?

mpienkowski commented 1 year ago

@Glench In my case, I have only the local extension version, no production version yet. I am using developer credentials to activate subscription.

philipmulcahy commented 1 year ago

It was my paid acct. I also achieved the same behaviour with my partner’s acct, and there is the original reporter’s acct too, but I have not got an easy way to repro with him any more, because the prod version now uses .paidSent from my phoneOn 27 Jun 2023, at 08:30, Maciej Pieńkowski @.***> wrote: @Glench In my case, I have only the local extension version, no production version yet. I am using developer credentials to activate subscription.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

Glench commented 1 year ago

I'm pretty sure this is related to #148. It's a caching issue that I've fixed in staging but will wait till the weekend to deploy to affect the minimal number of users.

Glench commented 1 year ago

OK, this was released Saturday morning US/ET time. Closing as resolved until I hear otherwise.

philipmulcahy commented 1 year ago

ThanksSent from my phoneOn 24 Jul 2023, at 15:27, Glen Chiacchieri @.***> wrote: OK, this was released Saturday morning US/ET time. Closing as resolved until I hear otherwise.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>