Uploaded image for project: 'Nuxeo Web UI'
  1. Nuxeo Web UI
  2. WEBUI-121

New hotfixed instance (in dev mode) leads to display of sw.js

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4.34, 2.4.35
    • Fix Version/s: HOTFIX_10.10_2.4, 3.x
    • Component/s: UI
    • Environment:
      Windows
      might happen on other browsers or OSes

      Description

      What: the internal JS script sw.js is displayed to users

      How to reproduce:

      • Take the the Nuxeo ZIP distribution and unjar it
        cd nuxeo-server-10.10-tomcat/bin
        nuxeoctl register # (use a Studio TOKEN)
        nuxeoctl mp-hotfix --accept=true
        nuxeoctl mp-install nuxeo-web-ui nuxeo-jsf-ui --accept=true
        nuxeoctl console
        
      • invoke http://localhost:8080
      • fill in the wizard information: all default (including Dev mode) but no need to install any other package
      • reboot from the GUI and wait for login page
      • login as Administrator/Administrator
        => The resulting URL looks like: http://localhost:8080/nuxeo/ui/sw.js?ts=1605452580213
        => the page looks like
        importScripts('workbox/workbox-sw.js');
        workbox.loadModule('workbox-strategies');
        
        const params = new URL(self.location.href).searchParams;
        if (params.has('ts')) {
          workbox.routing.registerRoute(
            ({ url, event }) => /\.*\.(html|js)$/.test(url) && event.request.headers.get('Content-Type') !== 'application/json',
            async ({ url, event }) => {
              const strategy = workbox.strategies.networkFirst();
              const request = new Request(`${url}?ts=${params.get('ts')}`, { credentials: 'same-origin' });
              return await strategy.makeRequest({ event, request });
            });
        }
        
        self.addEventListener('install', () => {
          self.skipWaiting();
        });
        

      Expected result: sw.js should never get displayed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                pabgrall Patrick Abgrall
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.