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

service worker errors in console? #1822

Closed
huumn opened this issue Jan 18, 2025 · 4 comments · Fixed by #1825
Closed

service worker errors in console? #1822

huumn opened this issue Jan 18, 2025 · 4 comments · Fixed by #1825
Labels
bug question further information is required

Comments

@huumn
Copy link
Member

huumn commented Jan 18, 2025

I'm not sure if this is normal or related to #1821 but I'm seeing these in prod.

Image
@huumn huumn added bug question further information is required labels Jan 18, 2025
@Soxasora
Copy link
Member

Soxasora commented Jan 18, 2025

There may be some waitUntil(s) that are useless but got added for precaution, the errors should spawn only on service worker's console though.
I'll take a look at what needs waitUntil and what doesn't.

Edit: more likely onPushSubscriptionChange since it gets triggered at every load without releasing any kind of promise, I'm not sure though as I'm not getting any errors

if (event.data.action === SYNC_SUBSCRIPTION) {
  return event.waitUntil(onPushSubscriptionChange(sw)(event, true))
}

edit2: I'm starting to think the culprit is google's workbox because I'm not getting errors from the eventListener

@huumn
Copy link
Member Author

huumn commented Jan 18, 2025

The line appears to be in the CLEAR_NOTIFICATIONS block if that helps.

Image

@Soxasora
Copy link
Member

Oh, thanks! I had a suspicion about it (waitUntil is called a bit too much after) but the lack of errors threw me far from it, posting a fix real quick!

@Soxasora
Copy link
Member

Apparently the error was there because CLEAR_NOTIFICATIONS gets triggered after getOS, which was still a classic await (my bad).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug question further information is required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants