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

(Mozilla 1437080) service workers: load after unload, or session restoration, may lead to 'Corrupted Content Error' or 'Cannot load app' #581

Closed
grahamperrin opened this issue May 24, 2018 · 13 comments

Comments

@grahamperrin
Copy link

@grahamperrin grahamperrin commented May 24, 2018

Steps

  1. https://meta.discourse.org/t/-/78008/24?u=grahamperrin
  2. open a new tab
  3. quit
  4. start
  5. restore the previous session
  6. bring the Discourse tab to the front

Expected

  1. automated load of the content

Actual result

  1. no load;

Corrupted Content Error

The site at https://meta.discourse.org/t/cannot-load-app-for-a-meta-topic/78008/24 has experienced a network protocol violation that cannot be repaired.

The page you are trying to view cannot be shown because an error in the data transmission was detected.

  • Please contact the website owners to inform them of this problem.

Try Again

Workaround

Space

Alternative workarounds include Control-L then Return or Enter, however for many users, it will be preferable to simply accept the invitation:

  • try again.

Notes If you see 'Cannot load app' in lieu of 'Corrupted Content Error', please state the build of Waterfox, from:
  • about:support

Please refrain from contacting the owners of meta.discourse.org. For this issue, re: http://www.discourse.org/about#browser we may expect the current release of Waterfox to be not supported by Discourse.

If you find an instance of Discourse that is not affected by this issue, please state both:

  • the URL; and
  • the version of Discourse.

Version information can be shown with Wappalyzer or its bookmarklet.

Thanks

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented May 24, 2018

Meta, tracking: #538

Reproducible with Waterfox 56.1.0 on a Mac.

Additional information Curiously, I began noticing this issue around the time of testing and release of 56.2.0. For example:

2018-05-20 19 53 35 version 2

Cannot load app

That was at home, https://discourse.mozilla.org/t/mozilla-buys-pocket-ask-your-questions-here/13998 with Discourse 2.0.0 I don't know which version of Discourse, and almost certainly version 56.2.0.7_1 of Waterfox on FreeBSD-CURRENT.

Today at home for the same URL, without a quit, I get the alternative symptom:

Corrupted Content Error

Discourse 2.0.0.

$ pkg info waterfox | grep Version
Version        : 56.2.0.13_1
$ date ; uname -v
Thu 24 May 2018 07:51:14 BST
FreeBSD 12.0-CURRENT #2 r333587: Mon May 14 01:59:02 BST 2018     root@momh167-gjp4-hpelitebook8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC 

– 56.2.0 build 20180523041847

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented May 24, 2018

Reproducible with Waterfox 56.1.0 on a Mac.

Refinement

  • 55.1.0: not reproducible
  • 56.0.3: not reproducible
  • 56.1.0 with Stylo disabled: reproducible.

I might find a Mozilla bug for this …

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented May 24, 2018

Symptoms of probably the same bug (I might need to change the title here):

  1. https://developer.microsoft.com/en-us/microsoft-edge/ not signed in
  2. click Sign in
  3. do not proceed with the sign in routine
  4. back

Result

  1. Corrupted Content Error … at https://developer.microsoft.com/en-us/microsoft-edge/
@grahamperrin grahamperrin changed the title 'Corrupted Content Error' or 'Cannot load app' after unloading Discourse content (Mozilla 1437080) service workers: load after unload, or session restoration, may lead to 'Corrupted Content Error' or 'Cannot load app' May 25, 2018
@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented Jun 2, 2018

Not all service worker-active PWAs are affected.

The Video Trimmer application at https://paulkinlan.github.io/videocut/index.html loads without error after a manual unload.

@MrAlex94
Copy link
Owner

@MrAlex94 MrAlex94 commented Jul 12, 2018

#694 (comment)

Could you see if these new commits fix it? I can't seem to repro so far :-0

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented Jul 13, 2018

Thanks.

56.2.1.55_3 at https://www.freshports.org/www/waterfox is a fraction behind, and I don't have a Windows test environment handy, so I might be unable to verify until Monday or later. Or …

if you have a .dmg of the pre-release handy, and if you can get it to me this morning (Friday) – PM or chat in Reddit, I guess – then I might be able to verify before the end of this afternoon.

In any case, don't let my lack of verification delay a release. If you made the issue reproducible, yourself, before the commits: that's good enough for me 👍


Bottom line: a fix will be smart but IMHO this issue is not a showstopper. If I understand correctly, the reported corruption is cache-specific; not a cause for concern (e.g. no data loss).

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented Jul 14, 2018

From #581 (comment):

Reproducible with Waterfox 56.1.0 on a Mac.

Unfortunately I no longer have the affected profile. Either that, or the service worker was automatically un-registered at some point.

With 56.2.1 (and 56.2.2) I can 'fake' registration by editing then locking serviceworker.txt, but I shouldn't treat this fakery as a reliable step towards verifying a fix. The worker remains active after registration disappears (from about:serviceworkers) and registration will reappear only after a quit of Waterfox, with the lock on the file … and so on. Feels clumsy.

With build 20180714033244 of 56.2.2 I can reproduce the symptom if there's no network connection:

2018-07-14 21 50 34

2018-07-14 21 51 16

– however, that's an edge case (I did not make any offline test in May or June) and maybe a separate Mozilla bug. I shouldn't keep this issue open for that alone.


For me it'll be sane to verify in a FreeBSD environment where I need not fake service worker registration. However we should not assume that the www/waterfox experiment will reach 56.2.2.

More practically: I reckon, seek verification of the fix in Windows case #694 after 56.2.2 is released.

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented Jul 15, 2018

Thanks @jbeich for making 56.2.2 available for FreeBSD.

… With build 20180714033244 of 56.2.2 (on Mac OS X 10.9.5) I can reproduce the symptom if there's no network connection: …

The same, or similar, with 56.2.2 on FreeBSD-CURRENT.

I might attach (or link to) a screen recording but essentially, it seems to happen in some cases if:

  • there's no network connection and
  • the worker for the affected page is not active before an unload

– then a load (after unload) may report corrupted content, and clicking Try again will not progress to a more user-friendly Server not found page.

As far as I could tell it seemed to affect e.g. Mozilla Discourse but not CNET (tested: Magic Leap's long-awaited headset will ship this summer -- and everything else we learned - CNET).

Let's close this. Thanks to Alex and Jan for the commits.

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented Jul 16, 2018

Two screen recordings

Mixtures of online and offline with 56.2.2 on FreeBSD-CURRENT.

2018-07-15 11:29.mp4.zip

2018-07-15 11:56.mp4.zip

From the second recording:

  • 04:47 on the timeline
  • going offline

04 47

  • 06:00
  • offline
  • service worker active
  • unloading

06 00

  • 06:11
  • still offline
  • loading

06 11

  • 06:33
  • still offline
  • service worker not active
  • reloading

06 33

  • 06:34
  • still offline
  • three frames – reloaded, blank, corrupted content error

06 34 a

06 34 b

06 34 c

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented Jul 16, 2018

Comparison with Firefox Quantum

Firefox 61.0.1 (64-bit) in safe mode on Kubuntu 17.10 on an old Ergo Vista 621 notebook.

https://roadtrip.glitch.me/ around forty-five minutes ago:

2018-07-16 03 51 25

I can not make it reproducible but I guess that there truly was a

network protocol violation

Re: cramforce/roadtrip#7 (comment) I had previously left the application, in Firefox, Finding my location then closed the notebook for ... I don't know how long. Days, probably.

This morning the reported corrupted content error (network protocol violation) occurred very shortly after I opened the notebook. Can't recall whether I attempted to reload the page.

@reitzig
Copy link

@reitzig reitzig commented Oct 19, 2018

I don't use Waterfox, but this was the best hit on Google. So, for the record, I still experience the error with FF 62.0.3 (Ubuntu 18.04).

@grahamperrin
Copy link
Author

@grahamperrin grahamperrin commented Oct 19, 2018

@reitzig please raise the issue in a support area for Firefox. If you already use Reddit, https://www.reddit.com/r/firefox/ might be ideal.

I'll join you there (not here; this issue is closed). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants