web-monetization-projects
web-monetization-projects copied to clipboard
After logging in, reactivated tabs should stream immediately without refresh
See here: https://linear.app/coil/issue/COIL-1503/coil-extension-hangs-at-setting-up-payment
Scenario 1:
- The user goes to a monetized site and is not logged in. Icon state= unavailable
- The user clicks on the browser action icon and is taken to coil.com
- The user logs in
- The user switches back to the site from step 1
Expectation: the site immediately starts streaming
Scenario 2:
- The user is logged in as test user A
- The user goes to a monetized site
- The user logs out
- The user logs in as test user B
- The user navigates back to the monetized site from step 2
Expectation: the site immediately starts streaming
Note that on logout, a lot of state is deleted in the background page, so we really need to either:
-
Not delete the relevant state Stream currently has a token, though with the DI now, it should be easy to inject the AuthService and get the token lazily rather than upon Stream construction as is currently the case
One would need to create the Stream during startWebMonetization so it can be "resumed" upon tab reactivation (after logging in)
-
Force the content script to send the startWebMonetization again If so, should it create new requestId[s] ? If there's a good argument for that, then option 2 is the only way to go