Open Bug 1257977 Opened 8 years ago Updated 2 years ago

queue tasks to update attributes on ServiceWorker and ServiceWorkerRegistration

Categories

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

defect

Tracking

()

People

(Reporter: bkelly, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: btpp-fixlater)

Attachments

(3 files, 3 obsolete files)

Currently the spec requires us to wait for statechange events to fire before activating directly after installation.  We probably need to wait for any statechange events any time .installing, .waiting, or .active are modified.  I have an issue for this:

  https://github.com/slightlyoff/ServiceWorker/issues/848

Currently we handle this by starting activate asynchronously.  Since we only fire statechange events on the main thread this ensures the event dispatch runnable has been flushed.  Once we implement bug 1113522, however, this will not be adequate.  We will need a more explicit async wait step.

Filing this to tackle after bug 1256428.
After thinking about this more I think we just need to implement something like this instead:

  https://github.com/slightlyoff/ServiceWorker/issues/860
Summary: explicitly wait for "statechange" events to fire → queue tasks to update attributes on ServiceWorker and ServiceWorkerRegistration
Depends on: 1260591
These patches are all refactoring towards allowing us to update registrations cleanly when the state of the registration changes.  More refactoring to come.  I'm trying to keep the patches small, so there will be lots of them.
Depends on: 1263307
Attachment #8737367 - Attachment is obsolete: true
Attachment #8737368 - Attachment is obsolete: true
Attachment #8737369 - Attachment is obsolete: true
Unfortunately I won't have time to complete this before moving to another effort.  I moved the first 3 patches to bug 1263307 to land separately.  The remaining patches are a work-in-progress towards associating DOM ServiceWorkerRegistration objects directly with their backing ServiceWorkerRegistrationInfo objects.  Once that is done we could more easily fire update to keep attributes in sync.
Assignee: bkelly → nobody
Status: ASSIGNED → NEW
Note this should also fix this issue if its still a problem in our implementation:

  https://github.com/slightlyoff/ServiceWorker/issues/851
Also we should include this spec issue when this bug is fixed:

  https://github.com/slightlyoff/ServiceWorker/issues/848
Whiteboard: btpp-fixlater
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: