Closed itschasa closed 7 months ago
This is actually necessary. It's weird
Does someone mind explaining?
In case someone who id using their own service worker or and didn’t include this check inside of it
In case someone who id using their own service worker or and didn’t include this check inside of it
Hasn't the check for it always been inside the service worker fetch function? I don't get how doing the check again before it enters the function's scope helps?
In case someone who id using their own service worker or and didn’t include this check inside of it
Hasn't the check for it always been inside the service worker fetch function? I don't get how doing the check again before it enters the function's scope helps?
no it was added recently because of some weird race conditions, its also good idiot proofing since anyone can modify the service worker and easily mess up this check somehow
race conditions my beloved
In case someone who id using their own service worker or and didn’t include this check inside of it
Hasn't the check for it always been inside the service worker fetch function? I don't get how doing the check again before it enters the function's scope helps?
no it was added recently because of some weird race conditions, its also good idiot proofing since anyone can modify the service worker and easily mess up this check somehow
Understood, I'll close the PR.
As mentioned in this comment on the commit: https://github.com/titaniumnetwork-dev/Ultraviolet/commit/6ddb73ecd4f2dfb3158771c57ff38d8927dcaf08#r140981857
This check is already performed in the
fetch
method: https://github.com/titaniumnetwork-dev/Ultraviolet/blob/c34745ffd0c97cd2e190300e57ce9e784474e638/src/uv.sw.js#L50-L58