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

bug: path request to subdomain redirect results in logged "event.respondWith" error #149

Open
SgtPooki opened this issue Mar 22, 2024 · 1 comment

Comments

@SgtPooki
Copy link
Member

When redirecting from a path domain to a subdomain, there is some async operation occurring that the service worker fetch handler isn't managing well and we're getting this error prior to the redirect:

Uncaught (in promise) DOMException: Failed to execute 'respondWith' on 'FetchEvent': The event handler is already finished.
    at http://localhost:3000/ipfs-sw-sw.js:917:15
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (http://localhost:3000/ipfs-sw-sw.js:760:103)
    at _next (http://localhost:3000/ipfs-sw-sw.js:761:194)
    at http://localhost:3000/ipfs-sw-sw.js:761:364
    at new Promise (<anonymous>)
    at http://localhost:3000/ipfs-sw-sw.js:761:97
    at http://localhost:3000/ipfs-sw-sw.js:921:20

note that you need preserve logs enabled for the console to see the error. this isn't a priority, because I believe any parallel requests the page kicks off on first load are interrupted when the redirect happens.

However, our code should be robust enough to not throw this error at all

@SgtPooki
Copy link
Member Author

SgtPooki commented Apr 8, 2024

note: I think we should be waiting to call event.respondWith instead of encapsulating deep promises inside of it. Otherwise, we can't capture this error which will throw if a request is aborted while in progress

@SgtPooki SgtPooki added this to the Initial release milestone Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant