LearnNewsExamplesServices
Frontmatter
id5899
titleExamples sometimes fail to load
stateClosed
labels
bug
assignees[]
createdAtSep 13, 2024, 4:49 PM
updatedAtSep 15, 2024, 4:53 PM
githubUrlhttps://github.com/neomjs/neo/issues/5899
authorjzombie
commentsCount4
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 15, 2024, 4:53 PM

Examples sometimes fail to load

Closed v8.1.0 bug
jzombie
jzombie commented on Sep 13, 2024, 4:49 PM

Describe the bug A clear and concise description of what the bug is.

Getting a "white screen" when first navigating to https://neomjs.com/dist/production/apps/portal/#/examples.

My apologies, I didn't capture any debug logs or a screenshot.

Happened in Chrome on Mac, from Nicaragua.

To Reproduce

This is tricky because I can't reproduce it, even in Incognito or in Firefox, but it's happened in the past as well on Chrome.

Expected behavior

To be able to view content.

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

Desktop (please complete the following information):

  • OS: macOS 13.6.7
  • Browser: Chrome
  • Version: 128.0.6613.120

Additional context My apologies I didn't capture a screenshot. I originally did and was going to post it on LinkedIn, but decided that a bug report was more appropriate. In the process, I deleted the screenshot that I took, and now can't seem to reproduce it.

jzombie added the bug label on Sep 13, 2024, 4:49 PM
tobiu
tobiu Sep 13, 2024, 5:03 PM

Hi Jeremy ( @jzombie ),

thanks for the input! I think this is related to the service worker (caching). In case I do deploy a new version, the SW gets notified and clears the entire cash. However, at this point it probably already is too late and some old files have been loaded. Especially problematic in dist/production => Webpack bundles.

A reload will already fix it, but I do agree that this is not a nice UX. What we can / should do: In case the SW gets the new version notification, it should tell the connected app about it => opening an alert / dialog, telling the user that a new version is available and a reload is required.

Thoughts?

Best regards, Tobi

jzombie
jzombie Sep 13, 2024, 5:53 PM

My thoughts are that if the page isn't loading at all, it should do a force reload, if that's possible. There was no content on the page at all.

tobiu
tobiu Sep 14, 2024, 12:40 PM

From a technical perspective, it has to be this spot: https://github.com/neomjs/neo/blob/dev/src/worker/ServiceBase.mjs#L252

If the version did change, we need to send back a versionChange message. This could either be a direct message or a broadcast to all connected clients. When receiving it, we can trigger a notification or reload.

tobiu referenced in commit 8a0f3eb - "#5899 trigger a location.reload() in case a connected service worker receives a new version." on Sep 15, 2024, 4:51 PM
tobiu
tobiu Sep 15, 2024, 4:53 PM

Hi Jeremy,

the "force reload when a SW gets a new version" is in place now. crossed fingers :)

While creating the changes, I managed to create an infinite reload loop (classic). So I learned how to kill a SW instance from a non-connected window.

Feel free to take a look into the commit.

Best regards, Tobi

tobiu closed this issue on Sep 15, 2024, 4:53 PM