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

Precaching idb fix #1139

Merged
merged 6 commits into from
Dec 18, 2017
Merged

Precaching idb fix #1139

merged 6 commits into from
Dec 18, 2017

Conversation

gauntface
Copy link

R: @jeffposnick @philipwalton

More changes to ensure idb works.

In IndexedDB version 1, we used two object stores 'workbox-precaching' and 'precaching-details-models'. In IndexedDB version 2 we only use 'precaching-details-models'. To ensure we are upgrading to a clean working state, this PR removes any old object stores and creates a new one.

Copy link
Member

@philipwalton philipwalton left a comment

Choose a reason for hiding this comment

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

LGTM, if/when we have multiple version upgrade paths in the future, I like the technique Jake suggests in the upgrading section his idb readme using switch statements with fall-through.

Copy link
Contributor

@jeffposnick jeffposnick left a comment

Choose a reason for hiding this comment

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

This generally seems fine (and I trust Phil's LGTM more than mine), but there is a Travis failure in the [workbox-precaching] Precache and Update end to end test.

Since you are changing the precaching code, can you confirm whether that's a false positive or a real issue?

@gauntface
Copy link
Author

So I fixed the integration tests, but the underlyinig indexedDB mock isn't correct, so I've raised a PR against phil's version of the repo here: philipwalton/shelving-mock-indexeddb#1

@workbox-pr-bot
Copy link
Collaborator

PR-Bot Size Plugin

Changed File Sizes

File Before After Change GZipped
packages/workbox-background-sync/build/workbox-background-sync.prod.js 3.17 KB 3.15 KB -1% 1.35 KB
packages/workbox-broadcast-cache-update/build/workbox-broadcast-cache-update.prod.js 1.05 KB 1.06 KB +1% 565 B
packages/workbox-cache-expiration/build/workbox-cache-expiration.prod.js 3.25 KB 3.23 KB -0% 1.20 KB
packages/workbox-cacheable-response/build/workbox-cacheable-response.prod.js 593 B 590 B -1% 343 B
packages/workbox-core/build/workbox-core.prod.js 6.67 KB 6.36 KB -5% 2.52 KB
packages/workbox-google-analytics/build/workbox-google-analytics.prod.js 1.94 KB 1.92 KB -1% 999 B
packages/workbox-precaching/build/workbox-precaching.prod.js 4.93 KB 4.98 KB +1% 1.92 KB
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.66 KB 1.65 KB -0% 814 B
packages/workbox-routing/build/workbox-routing.prod.js 2.74 KB 2.74 KB +0% 1.24 KB
packages/workbox-strategies/build/workbox-strategies.prod.js 3.22 KB 3.23 KB +0% 1.00 KB
packages/workbox-sw/build/workbox-sw.js 1.46 KB 1.46 KB +0% 794 B

New Files

No new files have been added.

All File Sizes

View Table
File Before After Change GZipped
packages/workbox-background-sync/build/workbox-background-sync.prod.js 3.17 KB 3.15 KB -1% 1.35 KB
packages/workbox-broadcast-cache-update/build/workbox-broadcast-cache-update.prod.js 1.05 KB 1.06 KB +1% 565 B
packages/workbox-build/build/_types.js 41 B 41 B 0% 61 B
packages/workbox-build/build/index.js 2.52 KB 2.52 KB 0% 1.06 KB
packages/workbox-cache-expiration/build/workbox-cache-expiration.prod.js 3.25 KB 3.23 KB -0% 1.20 KB
packages/workbox-cacheable-response/build/workbox-cacheable-response.prod.js 593 B 590 B -1% 343 B
packages/workbox-cli/build/app.js 4.57 KB 4.57 KB 0% 1.65 KB
packages/workbox-cli/build/bin.js 2.53 KB 2.53 KB 0% 1.07 KB
packages/workbox-core/build/workbox-core.prod.js 6.67 KB 6.36 KB -5% 2.52 KB
packages/workbox-google-analytics/build/workbox-google-analytics.prod.js 1.94 KB 1.92 KB -1% 999 B
packages/workbox-precaching/build/workbox-precaching.prod.js 4.93 KB 4.98 KB +1% 1.92 KB
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.66 KB 1.65 KB -0% 814 B
packages/workbox-routing/build/workbox-routing.prod.js 2.74 KB 2.74 KB +0% 1.24 KB
packages/workbox-strategies/build/workbox-strategies.prod.js 3.22 KB 3.23 KB +0% 1.00 KB
packages/workbox-sw/build/workbox-sw.js 1.46 KB 1.46 KB +0% 794 B
packages/workbox-webpack-plugin/build/index.js 7.29 KB 7.29 KB 0% 2.45 KB

Workbox Aggregate Size Plugin

☠️ WARNING ☠️

We are using 151% of our max size budget.

Total Size: 22.07KB
Percentage of Size Used: 151%

Gzipped: 8.81KB

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 84.736% when pulling c2c0d99 on precaching-idb-fix into 08d323e on v3.

@gauntface gauntface merged commit 8b4980b into v3 Dec 18, 2017
@gauntface gauntface deleted the precaching-idb-fix branch December 18, 2017 19:15
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.

5 participants