Closed Bug 1593003 Opened 4 years ago Closed 4 years ago

facebook.com ServiceWorker not successfully installing

Categories

(Core :: DOM: Service Workers, defect, P3)

72 Branch
Desktop
All
defect

Tracking

()

RESOLVED INVALID
Tracking Status
firefox-esr68 --- unaffected
firefox71 --- disabled
firefox72 --- disabled
firefox73 --- disabled
firefox74 --- wontfix

People

(Reporter: atrif, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: regression)

Attachments

(1 file)

Attached file facebook sw_errors.txt

Affected versions

  • 72.0a1 (20191030215116)

Affected platforms

  • Windows 10x64
  • macOS 10.14
  • Ubuntu 18.04

Steps to reproduce

  1. Open Firefox with a new profile and browser console.
  2. Open about:debugging,click on “This Nightly tab” and observe the Service Workers section.
  3. Go to facebook.com and log in with a valid username.
  4. Observe the service workers from about:debugging and the browser console.

Expected result

  • Service worker is successfully registered and there are no errors thrown in the console.

Actual result

  • Service Worker for facebook stays in “Registering” state a while and then disappears, throwing errors in the browser console.

Regression range
I will search for one ASAP if there is one.

Additional Notes

  • Attached two-screen recordings with the issue:
  • As seen in this screen recording after deleting history data there is possible that after revisiting facebook the service worker is successfully registered and working.
  • On this screen recording, the service worker is never registered.
  • The issue can be seen only when opening Firefox with a new profile or after deleting the history from about:preferences#privacy-> Clear History button. Revisiting Facebook without a new profile or with no history deleted will not try to install service worker.
  • I don’t know if it's the same issue as 1592911 but I think this is different because the facebook service worker is never registered if not clearing history once or multiple times.
  • Also the error "REQUEST_WORKERS_FAILURE: Protocol error (noSuchActor): No such actor for ID: server0.conn0.serviceWorkerRegistration42" can have different numbers at the end.
  • Attached the errors that are thrown in the browser console.
Has Regression Range: --- → no
Has STR: --- → yes

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression
Priority: -- → P2

Hello! After further investigation, it seems that the service worker can be successfully registered after following the next STR:

  1. Open Firefox with a new profile and login with valid credentials on Facebook.
  2. Click on "Allow notification" from the URL bar.
  3. Go to about:preferences#privacy and select "Clear History".
  4. Visit facebook again and log in again.
  5. Observe the about:debugging-> This Nightly-> Service Workers.

AR: Facebook Service Worker is successfully registered and working when clicking "Push".
Also if "Allow Notification" is pressed fast enough (like when they appear) the worker may be registered correctly on the first load.

Maybe FB is speculatively attempting to register the Service Workers and then checks for whether notifications are allowed later, and then unregistered the Service Worker if they aren't allowed...in which case this would all be the right behavior

Yes, that sounds like a reasonable theory. Going to downgrade to P3 for now. Thanks again for the thorough investigation, :atrif!

Priority: P2 → P3

Hello! It seems that the service worker for Facebook can be registered when going to Facebook settings-> Notifications-> Browser-> Switch "Firefox Push Notification" to on.
Given the fact that the service worker can be registered only when the "Allow Notification" is pressed fast enough (like when they appear). Is this the expected behavior? Thank's!

Flags: needinfo?(perry)
Flags: needinfo?(bugmail)

Sounds like the expected behavior to me. Thanks for checking!

Flags: needinfo?(perry)
Flags: needinfo?(bugmail)

(In reply to Perry Jiang [:perry] from comment #6)

Sounds like the expected behavior to me. Thanks for checking!

Can we close this then?

Flags: needinfo?(perry)

Yep!

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(perry)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.