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

self-contained installation: service worker prefetches missing files #4681

Open
2 tasks done
torkve opened this issue Oct 1, 2024 · 0 comments
Open
2 tasks done

self-contained installation: service worker prefetches missing files #4681

torkve opened this issue Oct 1, 2024 · 0 comments

Comments

@torkve
Copy link

torkve commented Oct 1, 2024

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

If you are technical, you should reporting bugs along the lines of https://marker.io/blog/how-to-write-bug-report. If you are not technical, we will make allowances, please try to make an effort to understand the process.

Describe the bug
I have intranet self-contained installation of drawio with all internet activity disabled and urlParams['offline']=1 enforced.

Recently I got some reports from my colleagues with chromium-based browsers, that when they embed diagrams into their pages through iframe, they occasionally see no diagram until page reload. The only hint they have is the following message in the browser console:

PrecacheStrategy.js:142 Uncaught (in promise) bad-precaching-response: bad-precaching-response :: [{"url":"https://drawio.domain/connect/jira/editor-1-3-3.html","status":404}]
    at C.O (https://drawio.domain/workbox-eb9c7348.js:1:10041)
    at async C._ (https://drawio.domain/workbox-eb9c7348.js:1:9639)
    at async C.U (https://drawio.domain/workbox-eb9c7348.js:1:8763)
O @ PrecacheStrategy.js:142
Object setTimeout (async)
(anonymous) @ timeout.js:17
cachePut @ timeout.js:17
O @ PrecacheStrategy.js:138
Object await in O (async)
_ @ PrecacheStrategy.js:71
Object await in _ (async)
U @ Strategy.js:144
Object await in U (async)
handleAll @ Strategy.js:135
(anonymous) @ PrecacheController.js:164
Object await in (anonymous) (async)
w @ waitUntil.js:18
install @ PrecacheController.js:151

When I started investigating, I found the following:

  1. Service worker is effectively enabled always when app is set to offline and PWA is not explicitly disabled.
  2. Service worker contains prefetch for file connect/jira/editor-1-3-3.html
  3. This file is missing both in drawio git repository and in official docker image jgraph/drawio. I rebuilt docker image myself, and it seems it is not downloaded at any moment.
  4. I do not know how service-worker.js is generated and if I can rebuild it during docker image build process.
  5. Official installation at app.diagrams.net has this file, so it is not affected by the problem.

I still don't know yet if it is the root cause of the original problem my colleagues reported, but it seems at least a problem by itself.

To Reproduce
Steps to reproduce the behavior:

  1. Install drawio on your own domain using official image jgraph/drawio
  2. Open browser console in any chromium based browser (e.g. Google Chrome).
  3. Go to https://drawio.yourdomain/?offline=1
  4. See prefetch error in console.

Expected behavior
No prefetch error expected.

Screenshots
If applicable, add screenshots to help explain your problem.

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 24.7.8

Desktop (please complete the following information):

  • OS: Ubuntu, Mac OS X
  • Browser chrome
  • Browser Version: 108

Smartphone (please complete the following information):
Not tested

I tested the problem in incognito/private mode with all browser extensions switched off, write "yes" below:
yes

Additional context
Add any other context about the problem here.

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