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

ServiceWorker is undefined #48

Closed
ketseh opened this issue Apr 22, 2022 · 6 comments · Fixed by #66
Closed

ServiceWorker is undefined #48

ketseh opened this issue Apr 22, 2022 · 6 comments · Fixed by #66
Assignees
Labels
app: dashboard Concerns the Dashboard UI priority: high Indicates a high priority issue type: bug Something isn't working weight: 1 An issue that has a very low development impact
Milestone

Comments

@ketseh
Copy link

ketseh commented Apr 22, 2022

What happened:

On opening the main page I'm getting the error in the devtools console:

Uncaught TypeError: navigator.serviceWorker is undefined

What you expected to happen:

No error is thrown

How to reproduce it:

Navigate to the dashboard's root page

Anything else we need to know?:

It seems to come from line 173
<script>navigator.serviceWorker.register('service-worker.js');</script>

@cdavernas cdavernas added app: dashboard Concerns the Dashboard UI type: bug Something isn't working labels Apr 22, 2022
@cdavernas cdavernas added this to the 0.2.0 milestone Apr 22, 2022
@JBBianchi
Copy link
Member

JBBianchi commented Apr 22, 2022

Sounds like your browser doesn't support service worker. Which navigator/version do you use? (Afaik, the only one not supporting service worker is IE)

@ketseh
Copy link
Author

ketseh commented Apr 22, 2022

Firefox 98.x

So, this looks like cosmetic then, right?
Probably just need to handle it a bit better to prevent "errors" in the console.

@JBBianchi
Copy link
Member

The service worker registration allows the PWA capabilities. It's more a "futurproof" thing than an actual feature for now. But anyways, we'll indeed prevent the error from appearing.

@JBBianchi
Copy link
Member

JBBianchi commented Apr 22, 2022

@ketseh out of curiosity, were you using Private Browsing Mode when testing? Because I think FFX 98 should support service workers. Or did you serve the page from an unsafe location (http instead of https) ?

@ketseh
Copy link
Author

ketseh commented Apr 22, 2022

http -- yes
private mode -- no

@JBBianchi
Copy link
Member

Maybe you want to unable 'unsafe' service workers then:

Service workers only run over HTTPS, for security reasons. Having modified network requests, wide open to 
man in the middle attacks would be really bad. In Firefox, Service Worker APIs are also hidden and cannot 
be used when the user is in private browsing mode.

Note: On Firefox, for testing you can run service workers over HTTP (insecurely); simply check the 
Enable Service Workers over HTTP (when toolbox is open) option in the Firefox Devtools options/gear menu.

src: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API#service_worker_concepts_and_usage

JBBianchi added a commit to neuroglia-io/synapse that referenced this issue Apr 25, 2022
feat(Dashboard): Continued graphical editor [skip hint]
refactor(Dagre): centered graph instead of zoom to fit after rendering [skip hint]

Closes serverlessworkflow#48 [skip hint]

Signed-off-by: JBBianchi <jb.bianchi@neuroglia.io>
@cdavernas cdavernas added priority: high Indicates a high priority issue weight: 1 An issue that has a very low development impact labels Apr 28, 2022
@cdavernas cdavernas changed the title navigator.serviceWorker is undefined ServiceWorker is undefined Apr 28, 2022
@cdavernas cdavernas reopened this Apr 28, 2022
JBBianchi added a commit to neuroglia-io/synapse that referenced this issue May 6, 2022
Details:
- feat(Dashboard): Added jq/jq expression input [skip hint]
- feat(Dashboard): Added state data filter input [skip hint]
- feat(Dashboard): Added InputDynamicObject [skip hint]
- feat(Dashboard): Added buttons to move state backward or forward in visual editor [skip hint]
- fix(Dashboard): Rehooked activity badge display [skip hint]
- fix(Dashboard): Prevented from starting a workflow when creating a workflow with autostart [skip hint]
- fix(Dashboard): Fixed "symbol" nodes sizes [skip hint]
- fix(Dasboard): Migrated toaster scss to app scss [skip hint]
- fix(Dashboard): Added AddStateContextualMenu border [skip hint]
- fix(Dashboard): Ensured unique state name in state editor
- fix(Dashboard): Changed elements sizes, fixed/improved badge positioning [skip hint]
- feat(Dashboard): Added drag and drop feature for workflow graph [skip hint]
- feat(Dashboard): Continued visual editor [skip hint]
- feat(Dashboard):  Added event handling for add/edit buttons in visual editor [skip hint]
- feat(Dashboard): Added interactions (add/edit) buttons in graphical editor [skip hint]
- fix(Dashboard): Verifying service worker support [skip hint]
- feat(Dashboard): Continued graphical editor [skip hint]
- refactor(Dagre): centered graph instead of zoom to fit after rendering [skip hint]
- feat(Dashboard): Continued graphical editor [skip hint]
- refactor(Dashboard): Extracted abstract ModalBase from Modal [skip hint]
- refactor(Dashboard): Added OnActiveChange event callback on ModalBase [skip hint]
- refactor(Dashboard): Added EditorModal and StateEditorModal [skip hint]
- refactor(Dashboard): Added WorkflowSummaryModal [skip hint]
- refactor(Dashboard): Added InjectStateSummaryModal [skip hint]
- refactor(Dashboard): Checked if event callbacks have delegate before invoiking them [skip hint]
- refactor(Dagre): Renamed Consts as Constant [skip hint]
- fix(Dashboard): Added description and default payload when starting a new workflow instance [skip hint]
- fix(Dashboard): Added titles to center and zoom to fit buttons [skip hint]
- refactor(Dashboard): Migrating create workflow page to flux pattern [skip hint]
- feat(Dashboard): Added activity badges component [skip hint]
- feat(Dashboard): Used condition eventref as label when displaying event switch state in WorkflowGraphBuilder [skip hint]
- fix(Dashboard): Fixed possible null reference on instances activities in GraphExtension [skip hint]
- docs(All): Added dashboard screenshot in README [skip hint]

Relates to serverlessworkflow#19 [skip hint]
Closes serverlessworkflow#48 [skip hint]
Closes serverlessworkflow#32 [skip hint]
Closes serverlessworkflow#34 [skip hint]

NOTES: this is a "squash" of the `dashboard` branch which is a mess. In the future, 1 fix = 1 branch, 1 feat = 1 branch ...

Signed-off-by: JBBianchi <jb.bianchi@neuroglia.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: dashboard Concerns the Dashboard UI priority: high Indicates a high priority issue type: bug Something isn't working weight: 1 An issue that has a very low development impact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants