From fae7e32d70d132a34e9ab8ef1c2e115561fe1038 Mon Sep 17 00:00:00 2001 From: Joep Meindertsma Date: Sat, 4 Feb 2023 22:51:29 +0100 Subject: [PATCH] Fix tests & pwa issue --- server/app_assets/sw.js | 2 +- server/app_assets/sw.js.map | 2 +- server/src/tests.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/app_assets/sw.js b/server/app_assets/sw.js index 6a04324db..95f422e18 100644 --- a/server/app_assets/sw.js +++ b/server/app_assets/sw.js @@ -1,2 +1,2 @@ -if(!self.define){let e,a={};const s=(s,i)=>(s=new URL(s+".js",i).href,a[s]||new Promise((a=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=a,document.head.appendChild(e)}else e=s,importScripts(s),a()})).then((()=>{let e=a[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(i,n)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(a[c])return;let t={};const o=e=>s(e,c),r={module:{uri:c},exports:t,require:o};a[c]=Promise.all(i.map((e=>r[e]||o(e)))).then((e=>(n(...e),t)))}}define(["./workbox-b77c083a"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index.css",revision:"9fe407de805ff09adf45038cd1428e1e"},{url:"assets/index.js",revision:"9262c3c729dfa59e0663cbb3c4e746f8"},{url:"index.html",revision:"cbe04d15ac622020ea8c4c868dc3981e"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"app_data/images/android-chrome-192x192.png",revision:"0c18f249158fb1312653ba5d58f99694"},{url:"app_data/images/android-chrome-512x512.png",revision:"fb7c0555e46c69807e43c38fc64e9b02"},{url:"app_data/images/maskable_icon.png",revision:"b2028eea26b14b5638e7dbdfe1fc044f"},{url:"app_data/images/maskable_icon_x512.png",revision:"9338a856b023f814f9bd9b6c9b58f3f5"},{url:"app_data/images/maskable_icon_x384.png",revision:"c83fdfe79ab1541a7b6f3dceec70a200"},{url:"app_data/images/maskable_icon_x192.png",revision:"dc9b09a2eff18baf7366764ac4c5bdca"},{url:"app_data/images/maskable_icon_x128.png",revision:"e2c63434d1928dedec819db66a473a98"},{url:"manifest.webmanifest",revision:"aa69e1459876f46ce0334485cb3ddfea"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"))),e.registerRoute(/^https:\/\/fonts\.googleapis\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-cache",plugins:[new e.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.gstatic\.com\/.*/i,new e.CacheFirst({cacheName:"gstatic-fonts-cache",plugins:[new e.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")})); +if(!self.define){let e,a={};const s=(s,i)=>(s=new URL(s+".js",i).href,a[s]||new Promise((a=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=a,document.head.appendChild(e)}else e=s,importScripts(s),a()})).then((()=>{let e=a[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(i,n)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(a[c])return;let t={};const o=e=>s(e,c),r={module:{uri:c},exports:t,require:o};a[c]=Promise.all(i.map((e=>r[e]||o(e)))).then((e=>(n(...e),t)))}}define(["./workbox-b77c083a"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index.css",revision:"9fe407de805ff09adf45038cd1428e1e"},{url:"assets/index.js",revision:"9262c3c729dfa59e0663cbb3c4e746f8"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"app_data/images/android-chrome-192x192.png",revision:"0c18f249158fb1312653ba5d58f99694"},{url:"app_data/images/android-chrome-512x512.png",revision:"fb7c0555e46c69807e43c38fc64e9b02"},{url:"app_data/images/maskable_icon.png",revision:"b2028eea26b14b5638e7dbdfe1fc044f"},{url:"app_data/images/maskable_icon_x512.png",revision:"9338a856b023f814f9bd9b6c9b58f3f5"},{url:"app_data/images/maskable_icon_x384.png",revision:"c83fdfe79ab1541a7b6f3dceec70a200"},{url:"app_data/images/maskable_icon_x192.png",revision:"dc9b09a2eff18baf7366764ac4c5bdca"},{url:"app_data/images/maskable_icon_x128.png",revision:"e2c63434d1928dedec819db66a473a98"},{url:"manifest.webmanifest",revision:"aa69e1459876f46ce0334485cb3ddfea"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"))),e.registerRoute(/^https:\/\/fonts\.googleapis\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-cache",plugins:[new e.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.gstatic\.com\/.*/i,new e.CacheFirst({cacheName:"gstatic-fonts-cache",plugins:[new e.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")})); //# sourceMappingURL=sw.js.map diff --git a/server/app_assets/sw.js.map b/server/app_assets/sw.js.map index 929e3fc57..f2126fb34 100644 --- a/server/app_assets/sw.js.map +++ b/server/app_assets/sw.js.map @@ -1 +1 @@ -{"version":3,"file":"sw.js","sources":["../../../../../../../private/var/folders/k1/tynj2xbn5nd12wm5qn3sc4600000gn/T/b8e8b3a7d1d467bebb80613960ec88e9/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-routing@6.5.4/node_modules/workbox-routing/registerRoute.mjs';\nimport {ExpirationPlugin as workbox_expiration_ExpirationPlugin} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-expiration@6.5.4/node_modules/workbox-expiration/ExpirationPlugin.mjs';\nimport {CacheableResponsePlugin as workbox_cacheable_response_CacheableResponsePlugin} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-cacheable-response@6.5.4/node_modules/workbox-cacheable-response/CacheableResponsePlugin.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-strategies@6.5.4/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-core@6.5.4/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-precaching@6.5.4/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-precaching@6.5.4/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-routing@6.5.4/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-precaching@6.5.4/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"assets/index.css\",\n \"revision\": \"9fe407de805ff09adf45038cd1428e1e\"\n },\n {\n \"url\": \"assets/index.js\",\n \"revision\": \"9262c3c729dfa59e0663cbb3c4e746f8\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"cbe04d15ac622020ea8c4c868dc3981e\"\n },\n {\n \"url\": \"registerSW.js\",\n \"revision\": \"1872c500de691dce40960bb85481de07\"\n },\n {\n \"url\": \"app_data/images/android-chrome-192x192.png\",\n \"revision\": \"0c18f249158fb1312653ba5d58f99694\"\n },\n {\n \"url\": \"app_data/images/android-chrome-512x512.png\",\n \"revision\": \"fb7c0555e46c69807e43c38fc64e9b02\"\n },\n {\n \"url\": \"app_data/images/maskable_icon.png\",\n \"revision\": \"b2028eea26b14b5638e7dbdfe1fc044f\"\n },\n {\n \"url\": \"app_data/images/maskable_icon_x512.png\",\n \"revision\": \"9338a856b023f814f9bd9b6c9b58f3f5\"\n },\n {\n \"url\": \"app_data/images/maskable_icon_x384.png\",\n \"revision\": \"c83fdfe79ab1541a7b6f3dceec70a200\"\n },\n {\n \"url\": \"app_data/images/maskable_icon_x192.png\",\n \"revision\": \"dc9b09a2eff18baf7366764ac4c5bdca\"\n },\n {\n \"url\": \"app_data/images/maskable_icon_x128.png\",\n \"revision\": \"e2c63434d1928dedec819db66a473a98\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"aa69e1459876f46ce0334485cb3ddfea\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\")));\n\n\nworkbox_routing_registerRoute(/^https:\\/\\/fonts\\.googleapis\\.com\\/.*/i, new workbox_strategies_CacheFirst({ \"cacheName\":\"google-fonts-cache\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 10, maxAgeSeconds: 31536000 }), new workbox_cacheable_response_CacheableResponsePlugin({ statuses: [ 0, 200 ] })] }), 'GET');\nworkbox_routing_registerRoute(/^https:\\/\\/fonts\\.gstatic\\.com\\/.*/i, new workbox_strategies_CacheFirst({ \"cacheName\":\"gstatic-fonts-cache\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 10, maxAgeSeconds: 31536000 }), new workbox_cacheable_response_CacheableResponsePlugin({ statuses: [ 0, 200 ] })] }), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox_precaching_cleanupOutdatedCaches","workbox","registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_routing_registerRoute","workbox_strategies_CacheFirst","cacheName","plugins","workbox_expiration_ExpirationPlugin","maxEntries","maxAgeSeconds","workbox_cacheable_response_CacheableResponsePlugin","statuses"],"mappings":"0nBA2BAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,qCAEb,IACHC,EAAAA,wBAC6BC,EAAAC,cAAC,IAAIC,EAAAA,gBAAgCC,EAAAA,wBAA2C,gBAG7GC,EAAAA,cAA8B,yCAA0C,IAAIC,aAA8B,CAAEC,UAAY,qBAAsBC,QAAS,CAAC,IAAIC,mBAAoC,CAAEC,WAAY,GAAIC,cAAe,UAAa,IAAIC,EAAAA,wBAAmD,CAAEC,SAAU,CAAE,EAAG,UAAc,OACpUR,EAAAA,cAA8B,sCAAuC,IAAIC,aAA8B,CAAEC,UAAY,sBAAuBC,QAAS,CAAC,IAAIC,mBAAoC,CAAEC,WAAY,GAAIC,cAAe,UAAa,IAAIC,EAAAA,wBAAmD,CAAEC,SAAU,CAAE,EAAG,UAAc"} \ No newline at end of file +{"version":3,"file":"sw.js","sources":["../../../../../../../private/var/folders/k1/tynj2xbn5nd12wm5qn3sc4600000gn/T/366279024344a08e760ab095b1928315/sw.js"],"sourcesContent":["import {registerRoute as workbox_routing_registerRoute} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-routing@6.5.4/node_modules/workbox-routing/registerRoute.mjs';\nimport {ExpirationPlugin as workbox_expiration_ExpirationPlugin} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-expiration@6.5.4/node_modules/workbox-expiration/ExpirationPlugin.mjs';\nimport {CacheableResponsePlugin as workbox_cacheable_response_CacheableResponsePlugin} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-cacheable-response@6.5.4/node_modules/workbox-cacheable-response/CacheableResponsePlugin.mjs';\nimport {CacheFirst as workbox_strategies_CacheFirst} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-strategies@6.5.4/node_modules/workbox-strategies/CacheFirst.mjs';\nimport {clientsClaim as workbox_core_clientsClaim} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-core@6.5.4/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-precaching@6.5.4/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-precaching@6.5.4/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-routing@6.5.4/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/Users/joep/dev/github/atomicdata-dev/atomic-data-browser/node_modules/.pnpm/workbox-precaching@6.5.4/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"assets/index.css\",\n \"revision\": \"9fe407de805ff09adf45038cd1428e1e\"\n },\n {\n \"url\": \"assets/index.js\",\n \"revision\": \"9262c3c729dfa59e0663cbb3c4e746f8\"\n },\n {\n \"url\": \"registerSW.js\",\n \"revision\": \"1872c500de691dce40960bb85481de07\"\n },\n {\n \"url\": \"app_data/images/android-chrome-192x192.png\",\n \"revision\": \"0c18f249158fb1312653ba5d58f99694\"\n },\n {\n \"url\": \"app_data/images/android-chrome-512x512.png\",\n \"revision\": \"fb7c0555e46c69807e43c38fc64e9b02\"\n },\n {\n \"url\": \"app_data/images/maskable_icon.png\",\n \"revision\": \"b2028eea26b14b5638e7dbdfe1fc044f\"\n },\n {\n \"url\": \"app_data/images/maskable_icon_x512.png\",\n \"revision\": \"9338a856b023f814f9bd9b6c9b58f3f5\"\n },\n {\n \"url\": \"app_data/images/maskable_icon_x384.png\",\n \"revision\": \"c83fdfe79ab1541a7b6f3dceec70a200\"\n },\n {\n \"url\": \"app_data/images/maskable_icon_x192.png\",\n \"revision\": \"dc9b09a2eff18baf7366764ac4c5bdca\"\n },\n {\n \"url\": \"app_data/images/maskable_icon_x128.png\",\n \"revision\": \"e2c63434d1928dedec819db66a473a98\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"aa69e1459876f46ce0334485cb3ddfea\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\")));\n\n\nworkbox_routing_registerRoute(/^https:\\/\\/fonts\\.googleapis\\.com\\/.*/i, new workbox_strategies_CacheFirst({ \"cacheName\":\"google-fonts-cache\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 10, maxAgeSeconds: 31536000 }), new workbox_cacheable_response_CacheableResponsePlugin({ statuses: [ 0, 200 ] })] }), 'GET');\nworkbox_routing_registerRoute(/^https:\\/\\/fonts\\.gstatic\\.com\\/.*/i, new workbox_strategies_CacheFirst({ \"cacheName\":\"gstatic-fonts-cache\", plugins: [new workbox_expiration_ExpirationPlugin({ maxEntries: 10, maxAgeSeconds: 31536000 }), new workbox_cacheable_response_CacheableResponsePlugin({ statuses: [ 0, 200 ] })] }), 'GET');\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox_precaching_cleanupOutdatedCaches","workbox","registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL","workbox_routing_registerRoute","workbox_strategies_CacheFirst","cacheName","plugins","workbox_expiration_ExpirationPlugin","maxEntries","maxAgeSeconds","workbox_cacheable_response_CacheableResponsePlugin","statuses"],"mappings":"0nBA2BAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,qCAEb,IACHC,EAAAA,wBAC6BC,EAAAC,cAAC,IAAIC,EAAAA,gBAAgCC,EAAAA,wBAA2C,gBAG7GC,EAAAA,cAA8B,yCAA0C,IAAIC,aAA8B,CAAEC,UAAY,qBAAsBC,QAAS,CAAC,IAAIC,mBAAoC,CAAEC,WAAY,GAAIC,cAAe,UAAa,IAAIC,EAAAA,wBAAmD,CAAEC,SAAU,CAAE,EAAG,UAAc,OACpUR,EAAAA,cAA8B,sCAAuC,IAAIC,aAA8B,CAAEC,UAAY,sBAAuBC,QAAS,CAAC,IAAIC,mBAAoC,CAAEC,WAAY,GAAIC,cAAe,UAAa,IAAIC,EAAAA,wBAAmD,CAAEC,SAAU,CAAE,EAAG,UAAc"} \ No newline at end of file diff --git a/server/src/tests.rs b/server/src/tests.rs index eb5f6e602..8b46047c9 100644 --- a/server/src/tests.rs +++ b/server/src/tests.rs @@ -34,7 +34,7 @@ fn build_request_authenticated(path: &str, appstate: &AppState) -> TestRequest { #[actix_rt::test] async fn server_tests() { let unique_string = atomic_lib::utils::random_string(10); - let opts = Opts::parse_from(&[ + let opts = Opts::parse_from([ "atomic-server", "--initialize", "--data-dir", @@ -54,7 +54,7 @@ async fn server_tests() { let app = test::init_service( App::new() .app_data(data) - .configure(|app| crate::routes::config_routes(app, &appstate.config)), + .configure(crate::routes::config_routes), ) .await; let store = &appstate.store;