LearnNewsExamplesServices
Frontmatter
id6584
titlePolishing the ServiceWorker implementation
stateClosed
labels
enhancement
assigneestobiu
createdAtMar 25, 2025, 11:27 AM
updatedAtMar 25, 2025, 6:32 PM
githubUrlhttps://github.com/neomjs/neo/issues/6584
authortobiu
commentsCount1
parentIssuenull
subIssues
6585 worker.ServiceBase: create a separate cache for each version
6586 worker.ServiceBase: onInstall() => remove the skipWaiting() call
6587 worker.Manager: add controllerchange SW listener as early as possible
6588 worker.ServiceBase: onFetch() => limit caching to event.request.method === ''GET''
6589 main.addon.ServiceWorker: registerServiceWorker()
6590 main.addon.ServiceWorker: registerServiceWorker() => updatefound listener
6591 worker.ServiceBase: onActivate() => clear previous caches
subIssuesCompleted7
subIssuesTotal7
blockedBy[]
blocking[]
closedAtMar 25, 2025, 6:32 PM

Polishing the ServiceWorker implementation

Closed v8.33.0 enhancement
tobiu
tobiu commented on Mar 25, 2025, 11:27 AM

While the current implementation works fine for caching related assets and even predictive caching via a MessageChannel connection to the app worker, it sometimes faces issues when deploying a new framework version to the online examples & website.

My assumption is, that the registerNeoConfig message arrives too late. Webpack can create different bundle file names, a previously cached asset is no longer available, which might result in a bug inside a main-thread and thus can prevent a reload.

Let's see if @dfabulich 's old guide can help a bit: https://redfin.engineering/how-to-fix-the-refresh-button-when-using-service-workers-a8e27af6df68

I will create sub-tasks (tickets).

tobiu added the enhancement label on Mar 25, 2025, 11:27 AM
tobiu assigned to @tobiu on Mar 25, 2025, 11:27 AM
tobiu added sub-issue #6585 on Mar 25, 2025, 11:29 AM
tobiu added sub-issue #6586 on Mar 25, 2025, 11:30 AM
tobiu added sub-issue #6587 on Mar 25, 2025, 11:33 AM
tobiu added sub-issue #6588 on Mar 25, 2025, 11:36 AM
tobiu added sub-issue #6589 on Mar 25, 2025, 2:06 PM
tobiu added sub-issue #6590 on Mar 25, 2025, 6:13 PM
tobiu added sub-issue #6591 on Mar 25, 2025, 6:17 PM
tobiu
tobiu Mar 25, 2025, 6:32 PM
tobiu closed this issue on Mar 25, 2025, 6:32 PM