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

Yet Another PWA Hang - after dashboard (or node red) update #1042

Open
colinl opened this issue Jun 30, 2024 · 0 comments
Open

Yet Another PWA Hang - after dashboard (or node red) update #1042

colinl opened this issue Jun 30, 2024 · 0 comments
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do

Comments

@colinl
Copy link
Contributor

colinl commented Jun 30, 2024

Current Behavior

On a system using cloudflare Zero Trust for authorisation, after upgrading node red and the dashboard (I don't know which was the trigger) I find that if, in addition, the authorisation token has expired, existing PWA apps hang on startup, showing a blank page.
In the developer tools I see
An error occurred: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Refresh does not fix it. However, if I clear the browser cache then it shows the cloudflare logon page, as it should.
It appears to be hitting the last console.error in this code from ui/src/main.mjs

fetch('_setup')
    .then(async (response) => {
...
    })
    .catch((err) => {
        if (err instanceof TypeError && err.message === 'Failed to fetch') {
            forcePageReload(err)
        } else {
            // handle general errors here
            console.error('An error occurred:', err)
        }
    })

In this case forcing a page reload would presumably fix it, but then there is the possibility of repeated reload attempts if the error is caused by something else. On the other hand, what else can we do if there is an error? Just hanging with a blank screen and no notification is not ideal.

Expected Behavior

No response

Steps To Reproduce

No response

Environment

  • Dashboard version: 1.12.1
  • Node-RED version: 4.0.1
  • Node.js version:
  • npm version:
  • Platform/OS: Ubuntu and Android
  • Browser: Edge and Chrome

Have you provided an initial effort estimate for this issue?

I am not a FlowFuse team member

@colinl colinl added bug Something isn't working needs-triage Needs looking at to decide what to do labels Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
None yet
Development

No branches or pull requests

1 participant