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
Race condition occurs when logging in as offline user with slow connection #7242
Comments
newtewt
changed the title
Race condition occurs when logging in as offline user with webdriverIO
Race condition occurs when logging in as offline user with slow connection
Sep 9, 2021
dianabarsan
added
Type: Bug
Fix something that isn't working as intended
and removed
Type: Technical issue
Improve something that users won't notice
labels
Sep 22, 2021
This is ready for AT on
|
Tested on local. LGTM @dianabarsan |
dianabarsan
added a commit
that referenced
this issue
Oct 10, 2021
Removes service-worker grunt task. Ddoc extraction no longer bumps the service-worker-meta doc. Service worker is now generated in API: - once on startup, after migrations - every time the main ddoc is updated - every time translations are changed (or added or removed) - every time the branding doc is changed If the call to sw-precache fails, the process crashes. Other errors are caught. Config that we pass to sw-precache is unchanged, excepting: - ignoreUrlParametersMatching now also includes username to fix the login page cache. - dynamicUrlToDependencies for the login page receives the generated html of login page (that includes branding and translations), to make sure cache is busted at the correct times. As a consequence, the login controller now exports a renderLogin method that returns the generated login page. After the service-worker file is generated (and saved in the same location as before), the service worker meta doc is updated. Updating the meta doc is skipped if no changes are made to the service-worker script (if the sha1 hash of the former file matches the sha1 hash of the new file). Migrates service-worker e2e test to wdio. Fixes race condition in bootstrap service-woker installation code, where registration promises only resolved when the service worker was already installed. On slow connections, where installation had not yet succeeded on the login page, the page would be left hanging. #6338 #7307 #7242
Merged to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the issue
When running a test for an offline user the service worker gets installed and registers. There is a race condition where
onupdatefound
is not triggered. This causes the app to log in and then sit on the "Downloading App..." screen.This can be recreated by checking out this branch and running
npm run wdio-local
on your local machine.This can be recreated in chrome using a local docker setup.
I setup my instance using the
scripts/docker-helper/cht-docker-compose.sh
Created an offline user.
Cleared cache and unregistered all service workers.
Opened a new blank tab. Set my network throttling to slow 3g
Navigate to my local instance https://192-168-1-215.my.local-ip.co/
Quickly log in as the offline user as soon as the login fields show.
The app sits on Downloading App... page
Describe the improvement you'd like
Resolve the race condition or potentially find another event to wait on in the test.
Describe alternatives you've considered
@dianabarsan has put together a change that possibly fixes this issue but needs to be vetted more thoroughly.
The text was updated successfully, but these errors were encountered: