If a user doesn't have the access pwa permission then when pwa/serviceworker/js is accessed pwa.pages.inc will not be loaded by menu_execute_active_handler(), which means pwa_deliver_js_file() isn't accessible, and therefore drupal_deliver_page() kicks out a watchdog error:

delivery callback not found: callback pwa_deliver_js_file not found: pwa/serviceworker/js.

I'm also seeing javascript errors:

The script has an unsupported MIME type ('text/html').
Failed to load resource: net::ERR_INSECURE_RESPONSE

Possible solutions:

  1. Load pwa.pages.inc ourselves (hook_init?)
  2. Move pwa_deliver_js_file() into pwa.module

I think 2 would be a cleaner solution.

Comments

MustangGB created an issue. See original summary.

mustanggb’s picture

Issue summary: View changes
joekrukosky’s picture

I used option #2 as a patch and it worked perfectly. Will upload patch file shortly...

joekrukosky’s picture

Patch based on option #2.

rudolfbyker’s picture

StatusFileSize
new1.74 KB

Patch in #4 is malformed. Try this one.

  • nod_ committed c236ea2 on 7.x-2.x
    Issue #3032124 by joekrukosky, rudolfbyker, MustangGB: delivery callback...
nod_’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Fixed

Fixed in the 7.x-2.x branch, thx

mustanggb’s picture

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.