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

reference error in PWA serviceworker #7372

Closed
Oreolek opened this issue Jul 7, 2019 · 6 comments · Fixed by #11538
Closed

reference error in PWA serviceworker #7372

Oreolek opened this issue Jul 7, 2019 · 6 comments · Fixed by #11538
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@Oreolek
Copy link

Oreolek commented Jul 7, 2019

ReferenceError: caches is not defined - serviceworker.js, line 60.

Appeared in #4730 PR, reproducible on https://try.gitea.io if you load Gitea in Firefox. Firefox doesn't have the caches variable.

@lunny lunny added the type/bug label Jul 7, 2019
@Cherrg
Copy link
Contributor

Cherrg commented Jul 7, 2019

Would you please add some more information like used Firefox version and OS, screenshoot, or a way to reproduce?

I've tried on my local machine and on https://try.gitea.io with Ubuntu 18 and FF 67.0.4 (64-Bit). Unluckily (or luckily) I don't got any error from service worker. Additionally I tried to manually uninstall SW, disable/re-enable cache, to force update of SW.

Thanks

grafik

@techknowlogick
Copy link
Member

FF 67.0.4 (64-bit), macOS 10.14.5, and I am getting same output as @Cherrg on try.gitea.io

@Oreolek
Copy link
Author

Oreolek commented Jul 9, 2019

UPD: that Firefox has dom.caches.enabled set to false, so the caches var is not defined on serviceworker registration.

@techknowlogick
Copy link
Member

@Oreolek is this something that you changed? My FF says what I have it set to is the default.

@Oreolek
Copy link
Author

Oreolek commented Jul 11, 2019

yes

@stale
Copy link

stale bot commented Sep 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Sep 9, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Sep 9, 2019
@stale stale bot removed the issue/stale label Sep 9, 2019
silverwind added a commit to silverwind/gitea that referenced this issue May 20, 2020
We don't really gain anything from it except the client-side caching
which is a problem better solved on HTTP level. Gitea is not a PWA and
will not do anything useful in a offline scenario without having access
to the server.

This should also resolve issues seen with the serviceworker interfering
on SSE requests.

The only API we can not use without a service worker is push
notifications while the "app" is closed but the more established
HTML Notification API will be a alternative.

Fixes: go-gitea#11092
Fixes: go-gitea#8056
Fixes: go-gitea#7372
silverwind added a commit to silverwind/gitea that referenced this issue May 21, 2020
Instead of statically hardcoding every frontend asset, this uses a
type-based approach to cache all js,css and manifest.json requests.

This also fixes the issue that the service worker was interfering with
EventSource because it was unconditionally handling all requests which
this new implementation doesn't.

Fixes: go-gitea#11092
Fixes: go-gitea#7372
techknowlogick pushed a commit that referenced this issue May 22, 2020
* Move serviceworker to workbox and fix SSE interference

Instead of statically hardcoding every frontend asset, this uses a
type-based approach to cache all js,css and manifest.json requests.

This also fixes the issue that the service worker was interfering with
EventSource because it was unconditionally handling all requests which
this new implementation doesn't.

Fixes: #11092
Fixes: #7372

* rethrow error instead of logging

* await .register

* Revert "rethrow error instead of logging"

This reverts commit 043162b.

* improve comment

* remove JSRenderer

* add version-based cache invalidation

* refactor

* more refactor

* remove comment

* rename item to fit cache name

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
silverwind added a commit to silverwind/gitea that referenced this issue May 22, 2020
* Move serviceworker to workbox and fix SSE interference

Instead of statically hardcoding every frontend asset, this uses a
type-based approach to cache all js,css and manifest.json requests.

This also fixes the issue that the service worker was interfering with
EventSource because it was unconditionally handling all requests which
this new implementation doesn't.

Fixes: go-gitea#11092
Fixes: go-gitea#7372

* rethrow error instead of logging

* await .register

* Revert "rethrow error instead of logging"

This reverts commit 043162b.

* improve comment

* remove JSRenderer

* add version-based cache invalidation

* refactor

* more refactor

* remove comment

* rename item to fit cache name

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
guillep2k added a commit that referenced this issue May 22, 2020
* Move serviceworker to workbox and fix SSE interference

Instead of statically hardcoding every frontend asset, this uses a
type-based approach to cache all js,css and manifest.json requests.

This also fixes the issue that the service worker was interfering with
EventSource because it was unconditionally handling all requests which
this new implementation doesn't.

Fixes: #11092
Fixes: #7372

* rethrow error instead of logging

* await .register

* Revert "rethrow error instead of logging"

This reverts commit 043162b.

* improve comment

* remove JSRenderer

* add version-based cache invalidation

* refactor

* more refactor

* remove comment

* rename item to fit cache name

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
ydelafollye pushed a commit to ydelafollye/gitea that referenced this issue Jul 31, 2020
* Move serviceworker to workbox and fix SSE interference

Instead of statically hardcoding every frontend asset, this uses a
type-based approach to cache all js,css and manifest.json requests.

This also fixes the issue that the service worker was interfering with
EventSource because it was unconditionally handling all requests which
this new implementation doesn't.

Fixes: go-gitea#11092
Fixes: go-gitea#7372

* rethrow error instead of logging

* await .register

* Revert "rethrow error instead of logging"

This reverts commit 043162b.

* improve comment

* remove JSRenderer

* add version-based cache invalidation

* refactor

* more refactor

* remove comment

* rename item to fit cache name

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
4 participants