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

[WIP TRACKING PR] Offline mode #161

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

[WIP TRACKING PR] Offline mode #161

wants to merge 346 commits into from

Conversation

scytacki
Copy link
Member

This is the long running offline branch.
This Draft PR is to help us track how we are doing with code coverage and see if there are merge conflicts when new code shows up in master.

@codecov
Copy link

codecov bot commented Mar 12, 2021

Codecov Report

Merging #161 (ca86ed3) into master (951dac8) will decrease coverage by 10.91%.
The diff coverage is 54.70%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #161       +/-   ##
===========================================
- Coverage   85.45%   74.54%   -10.92%     
===========================================
  Files          78       92       +14     
  Lines        2503     3473      +970     
  Branches      609      757      +148     
===========================================
+ Hits         2139     2589      +450     
- Misses        358      877      +519     
- Partials        6        7        +1     
Flag Coverage Δ
cypress 59.84% <43.90%> (-14.29%) ⬇️
jest 61.50% <42.75%> (-7.37%) ⬇️

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/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% <ø> (ø)
src/utilities/network-connection.ts 100.00% <ø> (ø)
... and 75 more

@scytacki scytacki changed the title Offline mode [WIP TRACKING PR] Offline mode Mar 12, 2021
scytacki and others added 28 commits March 13, 2021 09:47
this also changes the answers stored in indexedDB to have an resource_url
instead of an activity field
this also switches the url parameter name from report-source to sourceKey
…entUrl

a question id mismatch is only seen when looking at the portal-report
what really maters is the `activity` url parameter on the assignment in the portal,
that is what the portal-report uses.
but we'll want the resourceUrl here to match the activity parameter for when
the student starts using the activity when working offline.
this also changes the name of the database to avoid migration issues
The issue is that the AP code using the storage facade, doesn't update its own answer objects.
It is counting on the storage facade to call its answerWatcher callback and then it updates the
answer object.
So the dexie provider needs to implement the answerWatcher better. The implementation here
does does this watching within the current tab. It isn't using dexie observable or something
similar to watch for changes across tabs.

Also this code isn't supporting the unsubscribing of the watchers. It doesn't look like the AP code
is calling this unsubscribe, in the normal case, but it should be.
the manifest doesn't have a cacheList yet
It seems like the manifest authoring system doesn't pick up all assets.
So I think this list is incomplete.
…-contentUrl

update several parts of offline-mode
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
knowuh and others added 30 commits April 6, 2021 11:12
This prevents the situation where the files start installing before the service worker is updated.
Often when the install page is updated, the service worker needs to be updated too, so this
insures the the two versions match before running the install.
…econnect-issues

Check for existing FB connection before making a new one.
…tching-sw-version

Only start installing if the service worker version matches
…-glossary-version

Update glossary urls in offline manifest config to latest version
This has no manual changes.
It hasn't been tested yet.
manually add an additional lato font that I saw was being requested during testing
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
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
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