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

feat(service worker): add service worker functionality #101

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

DanielHabenicht
Copy link
Collaborator

@DanielHabenicht DanielHabenicht commented Jul 18, 2019

resolves #87

@DanielHabenicht
Copy link
Collaborator Author

Do not merge till at least 29.07 in order to auto uninstall the old service worker in our company.

@DanielHabenicht DanielHabenicht marked this pull request as ready for review December 2, 2019 10:46
@mmsgithub-ci
Copy link
Collaborator

Preview Environment ready at https://pr-101.demo-phonebook.me

@mmsgithub-ci
Copy link
Collaborator

Preview Environment ready at https://pr-101.demo-phonebook.me

@DanielHabenicht
Copy link
Collaborator Author

There is still a bug:
angular/angular#23613

Caused by us changing the environment variables in the index.html, possible solutions:

  1. remove the index.html hash from ngsw.json
  2. recalculate the hash.

This makes the service-worker work. Without it index.html would not be cached by the service worker
@DanielHabenicht
Copy link
Collaborator Author

DanielHabenicht commented Dec 3, 2019

@mschwrdtnr @paule96 @marcuskrahl @FrankLambrette please have a look at the PR-Preview and look out for issues that might come from the service worker (outdated info, double network requests, if it is working offline, for both languages etc.)

Please write back if any issues arise. If not we can merge and finally it will work for both English and German and completely offline 🎉 .

@mmsgithub-ci
Copy link
Collaborator

Preview Environment ready at https://pr-101.demo-phonebook.me

@mmsgithub-ci
Copy link
Collaborator

Preview Environment ready at https://pr-101.demo-phonebook.me

@mmsgithub-ci
Copy link
Collaborator

Preview Environment ready at https://pr-101.demo-phonebook.me

@VanLampe
Copy link
Contributor

VanLampe commented Dec 4, 2019

@DanielHabenicht could you please explain, how the page should work offline, so what should load and so on? If I set the network settings in chrome dev tools to offline, the page wont load any content anymore.

@DanielHabenicht
Copy link
Collaborator Author

/azp run T-Systems-MMS.phonebook-preview

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mmsgithub-ci
Copy link
Collaborator

Preview Environment ready at https://pr-101.demo-phonebook.me

@mschwrdtnr
Copy link
Member

@DanielHabenicht could you please explain, how the page should work offline, so what should load and so on? If I set the network settings in chrome dev tools to offline, the page wont load any content anymore.

Will test it after your answer :)

@DanielHabenicht
Copy link
Collaborator Author

DanielHabenicht commented Dec 9, 2019

I already described what to test here

look out for issues that might come from the service worker (outdated info, double network requests, if it is working offline, for both languages etc.)

Everything should work as if you are online. Report back everything that does not work.

@DanielHabenicht
Copy link
Collaborator Author

/azp run T-Systems-MMS.phonebook-preview

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mmsgithub-ci
Copy link
Collaborator

Preview Environment ready at https://pr-101.demo-phonebook.me

@VanLampe
Copy link
Contributor

@DanielHabenicht does the page needs a initial connection for working offline afterwards?

Not evrything can be loaded properly:
image

Rooms are not loading, so no content is shown if offline.

@DanielHabenicht
Copy link
Collaborator Author

@DanielHabenicht does the page needs a initial connection for working offline afterwards?

Does the page load if you are offline or not?

Not evrything can be loaded properly:
image

Rooms are not loading, so no content is shown if offline.

That's ok, dynamic content can't be preloaded. But everything you already searched for will be there.

@VanLampe
Copy link
Contributor

@DanielHabenicht does the page needs a initial connection for working offline afterwards?

Does the page load if you are offline or not?

If I reload the page with connection set to offline, it is not loading. But if I dont reload, evrything exept the rooms is loaded fine

@DanielHabenicht
Copy link
Collaborator Author

Can you send me some more information via chat?

@DanielHabenicht
Copy link
Collaborator Author

@T-Systems-MMS/phonebook-developers ping

@DanielHabenicht DanielHabenicht requested review from paule96, mschwrdtnr, Zeroks77 and a team and removed request for paule96 December 17, 2019 16:15
if (!this.store.selectSnapshot(AppState.serviceWorkerNotificationDisplayed)) {
if ('serviceWorker' in navigator) {
this.swUpdates.activated.subscribe(active => {
if (active.current) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When should that be opened? Didn't got any message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay. Got it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have opened! I will investigate. Good catch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got one dialog "Update your site" or something like..

Phonebook.Frontend/index_rehash.sh Show resolved Hide resolved
Copy link
Member

@mschwrdtnr mschwrdtnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works for me. Tested it locally, the preview and with different languages.

@DanielHabenicht
Copy link
Collaborator Author

/azp run T-Systems-MMS.phonebook-preview

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mmsgithub-ci
Copy link
Collaborator

Preview Environment ready at https://pr-101.demo-phonebook.me

@DanielHabenicht DanielHabenicht added the BLOCKED This Issue is blocked. Have a look in the comments. label Dec 19, 2019
@DanielHabenicht
Copy link
Collaborator Author

Blocked by Angular i18n, depending on $localize being runtime or AOT compiled.

@paule96 paule96 marked this pull request as draft September 8, 2020 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKED This Issue is blocked. Have a look in the comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Service Worker that works for both languages
5 participants