Skip to content

[TRACKING] Offline Mode Staging #234

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

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

[TRACKING] Offline Mode Staging #234

wants to merge 359 commits into from

Conversation

scytacki
Copy link
Member

@scytacki scytacki commented Apr 7, 2021

This is the intergration branch for offline-mode worker.
The offline-mode branch is the production branch and will trigger a release to schools if it is modified.
So new PRs should be merged into this offline-mode-dev branch first so they can be tested.

scytacki and others added 30 commits March 15, 2021 14:44
One more typing fix
[#177348535] -- Add optional`force_offline_data=true` query parameter

https://www.pivotaltracker.com/story/show/177348535
…te-answers

hacky untyped fix for the duplicate answers problem
…offline_data-param

Type out query parameter keys, add `force_offline_data` key.
…e-regression

Fix merge regression _currentOfflineActivityId → _currentOfflineResourceURL
The 0 status code is returned for opaque responses.  Since our fetch based cache filler use the no-cors option we get opaque responses for all external non-cors enabled servers.
…t-plugin-state

Save plugin state when exporting student data to JSON
these were not found before, perhaps because I didn't go to all of the pages
or perhaps this is related to the change that Doug made
This allows the PWA install icon to be seen in the long-lived offline-mode branch
Also added missing tests for offline-manifest-api (minus dexie tests)
…manifest

Update site manifest to make start_url and icons relative paths
…st-ordering

Added save of manifest name and activity order [#177347793]
# Conflicts:
#	cypress/integration/opening-reports.test.ts
#	src/components/activity-completion/completion-page-content.tsx
# Conflicts:
#	cypress/integration/opening-reports.test.ts
#	src/components/activity-completion/completion-page-content.tsx
Fix some issues post merge. Add `orderedQuestionsOnPage` helper
scytacki and others added 6 commits April 6, 2021 21:24
Also moved some storage-facade related type declarations to the top of the file.

[#177343947] Adding spec tests for storage facade
https://www.pivotaltracker.com/story/show/177343947
[#177343947] Adding spec tests for storage facade
https://www.pivotaltracker.com/story/show/177343947
…-storage-tests

177343947 add offline storage tests
@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #234 (5e2704a) into master (fe8e3ba) will decrease coverage by 10.17%.
The diff coverage is 58.44%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #234       +/-   ##
===========================================
- Coverage   85.57%   75.39%   -10.18%     
===========================================
  Files          78       93       +15     
  Lines        2509     3548     +1039     
  Branches      610      775      +165     
===========================================
+ Hits         2147     2675      +528     
- Misses        356      866      +510     
- Partials        6        7        +1     
Flag Coverage Δ
cypress 59.73% <43.44%> (-14.33%) ⬇️
jest 62.62% <46.63%> (-8.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/components/warning-banner.tsx 100.00% <ø> (ø)
src/service-worker.ts 88.40% <ø> (ø)
src/storage/data-sync-tracker.ts 85.93% <ø> (ø)
src/storage/dexie-storage.ts 100.00% <ø> (ø)
src/storage/firebase-db.ts 75.53% <ø> (ø)
src/storage/storage-facade.ts 28.21% <ø> (ø)
src/student-info.ts 48.78% <ø> (ø)
src/utilities/activity-utils.ts 81.53% <ø> (-10.95%) ⬇️
src/utilities/cypress.ts 100.00% <ø> (ø)
src/utilities/host-utils.ts 100.00% <ø> (ø)
... and 77 more

scytacki and others added 23 commits April 7, 2021 17:13
This makes it easier to test script changes. If --no-fetch-activities is used and
--bump-version is not used, then the manifest and activities will be updated
in place. The activities will not be fetched, but they might change if the script
does modifications that haven't been done already.
…est-updating

add support for in place manifest updating
during installing if the cache has a file with a etag that matches the revision in the manifest
then don't refetch the file.

this became more complicated because of CORS restrictions on reading the etag
most of our buckets don't alllow reading this etag from a CORS response
This makes it easier to test.
This also adds a test of of cacheUrlsWithProgress

This also identifies a potential problems with how we are getting the service worker to
send the cache message to

To make testing easier this also adds jest-mock-console
this also switches it from typescript to basic javascript
Jest 26 does not support transforming environments so typescript doesn't work.
this doesn't yet include a test for a request that is already in the cache
Co-authored-by: Noah Paessel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants