Skip to content

bug(ServiceWorker): multiple apps with ServiceWorker on one domain #21388

@skydever

Description

@skydever

I'm submitting a...

 [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question 

Current behavior

The installation of a 2nd App/ServiceWorker (with different baseHref) purges the Cache Storage entries for a previously installed App/ServiceWorker, if they are on the same domain. This breaks the 1st installed App. It is not reachable anymore - you will always be redirected to the latest installed App.

Expected behavior

The installation of multiple Apps/ServiceWorkers (with different baseHref) on one domain should be possible.

Minimal reproduction of the problem with instructions

I created the following repo to reproduce the issue: https://github.com/skydever/repro-multiple-ng-apps-one-domain-serviceworker. Follow the steps of the README there.

What is the motivation / use case for changing the behavior?

I have to deploy multiple Angular Apps on one domain.

Environment

 Angular version: 5.1.3 Browser: - [x] Chrome (desktop) version XX - [ ] Chrome (Android) version XX - [ ] Chrome (iOS) version XX - [ ] Firefox version XX - [ ] Safari (desktop) version XX - [ ] Safari (iOS) version XX - [ ] IE version XX - [ ] Edge version XX For Tooling issues: - Node version: v8.9.1 - Platform: Windows Others: 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions