mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #4628] [bug]: Service worker caching the wrong version #1716
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1716
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LorenzoRogai on GitHub (Dec 18, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4628
Is there an existing issue for this?
Current behavior
Currently, when I reload the page after the initial load, it breaks. The issue seems to stem from the service worker caching an incorrect version with the wrong environment variables. However, if I perform a hard reload (CMD + Shift + R) or de-register the service worker, the page loads correctly.
For reference, i'm using Caddy as reverse proxy.
Steps to reproduce
Can't reproduce, probably it happens only if you change the env variables after a first docker-compose up -d
Environment
Production
Version
Self-hosted
@LordSimal commented on GitHub (Jan 21, 2025):
Same issue with NGINX as a reverse proxy on self-hosted 2024.12.1
Its cool, that you already identified, that its a service worker problem. Therefore it can't really be a webserver/HTTP cache problem imho, but rather a cache invalidation problem inside the service worker.
Do you know where in the source code one could easily disable the service worker for self-hosted installations? At least this would fix that annoying bug for the time being.
@LorenzoRogai commented on GitHub (Jan 21, 2025):
@LordSimal no i wasn't able to find a way to disable them in the source code, in the meanwhile i'm using a Chrome extension https://chromewebstore.google.com/detail/block-service-workers/ceokjgeibfjfcboemhdpkdalankbmnej?hl=en that blocks them
@LordSimal commented on GitHub (Jan 21, 2025):
it looks like they are using workbox as the lib to write the service worker logic
https://github.com/hoppscotch/hoppscotch/blob/main/packages/hoppscotch-selfhost-web/package.json#L42
@LordSimal commented on GitHub (Jan 22, 2025):
Maybe commenting out this config block could help, but I don't know how to trigger a rebuild of the web app
https://github.com/hoppscotch/hoppscotch/blob/main/packages/hoppscotch-selfhost-web/vite.config.ts#L150-L227