Skip to content

[web] ServiceWorker "installing" may be null right after calling "update()" #101459

Description

@ditman

In certain (unknown) cases, a service worker registration object may return a null serviceworker in installing state, right after calling update() on the service worker registration object.

The below initialization code (shared by many flutter web apps) is affected:

  • } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
    // When the app updates the serviceWorkerVersion changes, so we
    // need to ask the service worker to update.
    console.log('New service worker available.');
    reg.update();
    waitForActivation(reg.installing);
    } else {

(reg.installing is null, when it shouldn't.)

Steps to Reproduce

@yjbanov managed to get his Chrome browser (v100, gLinux) in this state and immediately reported the issue, but I couldn't repro. The only way we've had to reproduce the issue was to eliminate forking in the code at this point, and force the code through that specific branch.

Expected results: An app running

Actual results: A variation of this error:

Screen Shot 2022-04-06 at 3 49 58 PM

Activity

  1. added
    P1High-priority issues at the top of the work list
    on Apr 6, 2022
  2. github-actions commented on Apr 26, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  3. locked as resolved and limited conversation to collaborators on Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listplatform-webWeb applications specifically

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions