Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move scrobble service calls to service worker #3818

Merged
merged 4 commits into from
Jun 4, 2023

Conversation

yayuyokitano
Copy link
Member

@yayuyokitano yayuyokitano commented May 30, 2023

This PR has the potential to cause massive destruction if it is not working correctly.

Achieves a few things.
First of all, the code now gets around adblockers no problem.
Second, this sets us up nicely to add code to avoid requiring users to refresh on every update being applied without risking it resulting in double scrobbles, as all scrobble control is now in the service worker, which we know will be gone when our new one is up. We have no control over content scripts and they stay loaded after update.
Third, it also removes some not that necessary logs from content script which I think is a good thing.

Some additional testing on this to make sure it works would be appreciated.
Note that a couple of the automated tests break due to a lack of a polyfill.
This needs a fixing before merge though doesn't represent an actual regression FWIW.

EDIT: Also another nice side effect of this PR is that the extension is a lot more gung-ho about reattempting to get session, which should mean that it is harder to accidentally get a service error after going through authentication.

@yayuyokitano yayuyokitano added core This issue or pull request is related to the extension core patch-change For patch changes labels May 30, 2023
Copy link
Member

@inverse inverse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit to me from the testing I've been doing. Wasnt too extensive though

@jaccarmac you able to try too?

src/core/background/main.ts Show resolved Hide resolved
src/core/background/scrobble.ts Outdated Show resolved Hide resolved
@jaccarmac
Copy link
Contributor

@jaccarmac you able to try too?

Haven't looked yet.

@yayuyokitano
Copy link
Member Author

Had a couple people try this in the discord as well without running into issues, it seems to be stable, merging.

@yayuyokitano yayuyokitano merged commit bf89289 into web-scrobbler:master Jun 4, 2023
@yayuyokitano yayuyokitano deleted the scrobble branch June 4, 2023 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core This issue or pull request is related to the extension core patch-change For patch changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants