@patodo/localapp 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.localapp-artifact.json +106 -86
- package/README.md +1 -1
- package/bin/localapp.mjs +53 -14
- package/package.json +1 -1
- package/runtime/native/adapter-manifest.json +1 -1
- package/runtime/native/win32-x64/localapp-native.exe +0 -0
- package/runtime/server/.localapp-server-runtime.json +58 -58
- package/runtime/server/bin/server-cli.cjs +49 -16
- package/runtime/server/bin/worker.cjs +17991 -17926
- package/runtime/server/web/404.html +1 -1
- package/runtime/server/web/inbox.html +1 -1
- package/runtime/server/web/inbox.txt +1 -1
- package/runtime/server/web/index.html +1 -1
- package/runtime/server/web/index.txt +1 -1
- package/runtime/server/web/my/analytics.html +1 -1
- package/runtime/server/web/my/analytics.txt +1 -1
- package/runtime/server/web/my/apps/placeholder/settings.html +1 -1
- package/runtime/server/web/my/apps/placeholder/settings.txt +1 -1
- package/runtime/server/web/my/apps.html +1 -1
- package/runtime/server/web/my/apps.txt +1 -1
- package/runtime/server/web/my/dashboard.html +1 -1
- package/runtime/server/web/my/dashboard.txt +1 -1
- package/runtime/server/web/my/device-actions.html +1 -1
- package/runtime/server/web/my/device-actions.txt +1 -1
- package/runtime/server/web/my/device-notifications.html +1 -1
- package/runtime/server/web/my/device-notifications.txt +1 -1
- package/runtime/server/web/my/favorites.html +1 -1
- package/runtime/server/web/my/favorites.txt +1 -1
- package/runtime/server/web/my/groups.html +1 -1
- package/runtime/server/web/my/groups.txt +1 -1
- package/runtime/server/web/my/info.html +1 -1
- package/runtime/server/web/my/info.txt +1 -1
- package/runtime/server/web/my/keys.html +1 -1
- package/runtime/server/web/my/keys.txt +1 -1
- package/runtime/server/web/my/orgs.html +1 -1
- package/runtime/server/web/my/orgs.txt +1 -1
- package/runtime/server/web/my/pages.html +1 -1
- package/runtime/server/web/my/pages.txt +1 -1
- package/runtime/server/web/my/peers.html +1 -1
- package/runtime/server/web/my/peers.txt +1 -1
- package/runtime/server/web/my/recent.html +1 -1
- package/runtime/server/web/my/recent.txt +1 -1
- package/runtime/server/web/my/settings.html +1 -1
- package/runtime/server/web/my/settings.txt +1 -1
- package/runtime/server/web/my/studio.html +1 -1
- package/runtime/server/web/my/studio.txt +1 -1
- package/runtime/server/web/my/subscriptions.html +1 -1
- package/runtime/server/web/my/subscriptions.txt +1 -1
- package/runtime/server/web/my/system.html +1 -1
- package/runtime/server/web/my/system.txt +1 -1
- package/runtime/server/web/my/tasks.html +1 -1
- package/runtime/server/web/my/tasks.txt +1 -1
- package/runtime/server/web/my/users.html +1 -1
- package/runtime/server/web/my/users.txt +1 -1
- package/runtime/server/web/my.html +1 -1
- package/runtime/server/web/my.txt +1 -1
- package/runtime/server/web/platform-shell/placeholder/placeholder.html +1 -1
- package/runtime/server/web/platform-shell/placeholder/placeholder.txt +1 -1
- package/runtime/server/web/platform-shell-preview.html +1 -1
- package/runtime/server/web/platform-shell-preview.txt +1 -1
- package/runtime/server/web/setup.html +1 -1
- package/runtime/server/web/setup.txt +1 -1
- package/template/runtime/server-core/dist/lib/__tests__/runtime-errors.test.d.ts +2 -0
- package/template/runtime/server-core/dist/lib/__tests__/runtime-errors.test.d.ts.map +1 -0
- package/template/runtime/server-core/dist/lib/__tests__/runtime-errors.test.js +37 -0
- package/template/runtime/server-core/dist/lib/__tests__/runtime-errors.test.js.map +1 -0
- package/template/runtime/server-core/dist/lib/app-db.d.ts.map +1 -1
- package/template/runtime/server-core/dist/lib/app-db.js +8 -18
- package/template/runtime/server-core/dist/lib/app-db.js.map +1 -1
- package/template/runtime/server-core/dist/lib/runtime-errors.d.ts +21 -1
- package/template/runtime/server-core/dist/lib/runtime-errors.d.ts.map +1 -1
- package/template/runtime/server-core/dist/lib/runtime-errors.js +55 -0
- package/template/runtime/server-core/dist/lib/runtime-errors.js.map +1 -1
- package/template/runtime/version.json +1 -1
- /package/runtime/server/web/_next/static/{53tcXasdrXUY226RhYFJX → JieMOnNo6o-tBoC3hEZbI}/_buildManifest.js +0 -0
- /package/runtime/server/web/_next/static/{53tcXasdrXUY226RhYFJX → JieMOnNo6o-tBoC3hEZbI}/_ssgManifest.js +0 -0
|
Binary file
|
|
@@ -5,18 +5,16 @@
|
|
|
5
5
|
"nodeMajor": 24,
|
|
6
6
|
"entrypoint": "bin/server.mjs",
|
|
7
7
|
"worker": "bin/worker.cjs",
|
|
8
|
-
"bundleDigest": "
|
|
8
|
+
"bundleDigest": "e71858d501280aade6facdc6b25fcf157da91a7da094d9ae820c5c40f7abec11",
|
|
9
9
|
"files": {
|
|
10
|
-
"bin/server-cli.cjs": "
|
|
10
|
+
"bin/server-cli.cjs": "6fbfd2e058611eb72994b2f3f3ee20859cd1a094a127f0d70709968f20d31e9d",
|
|
11
11
|
"bin/server.mjs": "169c9fb9fc8aebafb1bffa08f968d28d3d5ac90ea49c3ef0e919a9d3751ef46e",
|
|
12
|
-
"bin/worker.cjs": "
|
|
12
|
+
"bin/worker.cjs": "50456f1fec3cbf95af31bdb281e2981eea494384d86ede5b90af591449fb0ee5",
|
|
13
13
|
"node_modules/sql.js/dist/sql-wasm.js": "77d6435bac506af0e3c59636dce9d22b1b14156348bc327f41a1577f3212360f",
|
|
14
14
|
"node_modules/sql.js/dist/sql-wasm.wasm": "438c88f666dc054ce4e9395f80fe9db4218b1a3c379960454880f048a7898aed",
|
|
15
15
|
"node_modules/sql.js/package.json": "4c661e7817ffe4076bcc3f79f3a8085cb0a87685e6c21d50fd203a85b0c80bc2",
|
|
16
16
|
"package.json": "92a425e61cbf6f34f70a92ef5442c0940f4698e9940ffa15c9ad7fd52316c5ca",
|
|
17
17
|
"runner/localapp-runner.mjs": "42dad8392a99d540d899acd4944f3666f0a6df45d494bd636cafebcf6dbd1928",
|
|
18
|
-
"web/_next/static/53tcXasdrXUY226RhYFJX/_buildManifest.js": "1579cca2cfb60767afbd3bf6d816c7aace6546c08ecad3ef14013e372a601b77",
|
|
19
|
-
"web/_next/static/53tcXasdrXUY226RhYFJX/_ssgManifest.js": "aa399ebd05ef75d6e93cfaba1c116b730fd190817293523ef7d4e16510d9571b",
|
|
20
18
|
"web/_next/static/chunks/184-184da63eba05808f.js": "9e8b391b76428164391acb9cc0e05e025a898cb467900625c85336b5f221b8c0",
|
|
21
19
|
"web/_next/static/chunks/265-a58973dbf631dc41.js": "48830345189d9e3171aa251dcf579f89aa0ee47c96d982c7894192319d8bef4d",
|
|
22
20
|
"web/_next/static/chunks/308-d74213c6f5179bf0.js": "6b73b11ec49b58e3e15bbef51f5067c169e54d4f6f05c5be1696846a91745308",
|
|
@@ -64,6 +62,8 @@
|
|
|
64
62
|
"web/_next/static/chunks/polyfills-42372ed130431b0a.js": "0973c1d64c88adc8e3c950410cb58b288f72118d5965b78049438deb8f2f9683",
|
|
65
63
|
"web/_next/static/chunks/webpack-0bed2fdf6baa566e.js": "0c81222531b99e5a1ba049065536321abe79d06a7c4ca359655faebb9516b26b",
|
|
66
64
|
"web/_next/static/css/b8973d29c0d3fd9b.css": "501da8d62fc85a503c64bae6336d161b0f557564d4d6fc440e3489d155ae6919",
|
|
65
|
+
"web/_next/static/JieMOnNo6o-tBoC3hEZbI/_buildManifest.js": "1579cca2cfb60767afbd3bf6d816c7aace6546c08ecad3ef14013e372a601b77",
|
|
66
|
+
"web/_next/static/JieMOnNo6o-tBoC3hEZbI/_ssgManifest.js": "aa399ebd05ef75d6e93cfaba1c116b730fd190817293523ef7d4e16510d9571b",
|
|
67
67
|
"web/_next/static/media/013b72fa676f92e0-s.woff2": "e27f657e38d52887baa3b6b2f812bef93dfdd356f0810e40edd4ee284cc7e9f6",
|
|
68
68
|
"web/_next/static/media/22a5144ee8d83bca-s.p.woff2": "9b6f5ff45b278c744b5f379a2c4ecbaf858a842b8eaf82ac8d21b699ca16c608",
|
|
69
69
|
"web/_next/static/media/2b5b02fc7e511755-s.woff2": "745994b5cd950ec201b66526375f057d540847cccfc70f4f24f5f571d26d3923",
|
|
@@ -75,59 +75,59 @@
|
|
|
75
75
|
"web/_next/static/media/b9408752a0c24fb9-s.woff2": "75b3bedbebc35f347c0ae3b416aa871941555357e7b0f83767eb5987875589ed",
|
|
76
76
|
"web/_next/static/media/e038a29029a234f2-s.woff2": "16e1d48b6dd29eb240aec5db36184eb182933c082cd43de7f35af686d58087d2",
|
|
77
77
|
"web/_next/static/media/f639721981034f88-s.woff2": "b7a545bbb08256bd809f11cfe66d88da3e22d169ea4407737b1ef0ec1ed3d791",
|
|
78
|
-
"web/404.html": "
|
|
78
|
+
"web/404.html": "c086018c7e3c12fb2b198fe4e75b51d62bd0256d9409d413d4615d9d8782d559",
|
|
79
79
|
"web/home/redline-launch-hero.png": "4498c4aee99b2a6ffd706f8115153525542d3a0f76fbcdc4a47b77ec92b93547",
|
|
80
|
-
"web/inbox.html": "
|
|
81
|
-
"web/inbox.txt": "
|
|
82
|
-
"web/index.html": "
|
|
83
|
-
"web/index.txt": "
|
|
84
|
-
"web/my/analytics.html": "
|
|
85
|
-
"web/my/analytics.txt": "
|
|
86
|
-
"web/my/apps/placeholder/settings.html": "
|
|
87
|
-
"web/my/apps/placeholder/settings.txt": "
|
|
88
|
-
"web/my/apps.html": "
|
|
89
|
-
"web/my/apps.txt": "
|
|
90
|
-
"web/my/dashboard.html": "
|
|
91
|
-
"web/my/dashboard.txt": "
|
|
92
|
-
"web/my/device-actions.html": "
|
|
93
|
-
"web/my/device-actions.txt": "
|
|
94
|
-
"web/my/device-notifications.html": "
|
|
95
|
-
"web/my/device-notifications.txt": "
|
|
96
|
-
"web/my/favorites.html": "
|
|
97
|
-
"web/my/favorites.txt": "
|
|
98
|
-
"web/my/groups.html": "
|
|
99
|
-
"web/my/groups.txt": "
|
|
100
|
-
"web/my/info.html": "
|
|
101
|
-
"web/my/info.txt": "
|
|
102
|
-
"web/my/keys.html": "
|
|
103
|
-
"web/my/keys.txt": "
|
|
104
|
-
"web/my/orgs.html": "
|
|
105
|
-
"web/my/orgs.txt": "
|
|
106
|
-
"web/my/pages.html": "
|
|
107
|
-
"web/my/pages.txt": "
|
|
108
|
-
"web/my/peers.html": "
|
|
109
|
-
"web/my/peers.txt": "
|
|
110
|
-
"web/my/recent.html": "
|
|
111
|
-
"web/my/recent.txt": "
|
|
112
|
-
"web/my/settings.html": "
|
|
113
|
-
"web/my/settings.txt": "
|
|
114
|
-
"web/my/studio.html": "
|
|
115
|
-
"web/my/studio.txt": "
|
|
116
|
-
"web/my/subscriptions.html": "
|
|
117
|
-
"web/my/subscriptions.txt": "
|
|
118
|
-
"web/my/system.html": "
|
|
119
|
-
"web/my/system.txt": "
|
|
120
|
-
"web/my/tasks.html": "
|
|
121
|
-
"web/my/tasks.txt": "
|
|
122
|
-
"web/my/users.html": "
|
|
123
|
-
"web/my/users.txt": "
|
|
124
|
-
"web/my.html": "
|
|
125
|
-
"web/my.txt": "
|
|
126
|
-
"web/platform-shell/placeholder/placeholder.html": "
|
|
127
|
-
"web/platform-shell/placeholder/placeholder.txt": "
|
|
128
|
-
"web/platform-shell-preview.html": "
|
|
129
|
-
"web/platform-shell-preview.txt": "
|
|
130
|
-
"web/setup.html": "
|
|
131
|
-
"web/setup.txt": "
|
|
80
|
+
"web/inbox.html": "e3fcd9017245212701f59940667c07fcc85c60e629fbd6c3f5a4096894fd8cb2",
|
|
81
|
+
"web/inbox.txt": "eb6b7d5b721f4da6f3645e8e9ec1825dd5b1afbbe7a1ee8b204d4de5b7905fcb",
|
|
82
|
+
"web/index.html": "048f25d099a572137c63a69e45306d0e1fb585d1b7771287f1d457e703e3964a",
|
|
83
|
+
"web/index.txt": "d10cbf326d229bda3884ec0fc19202bec8c5a524c800417dc4a1f740cfd9939e",
|
|
84
|
+
"web/my/analytics.html": "cb66933fd98104c4a3e1b99a14bdf0d77a1f739360a2d5c2bfa33f62c20a56c2",
|
|
85
|
+
"web/my/analytics.txt": "bdc0232da18315d6e18e49ace19ef1d92903f8dc4308f94ff9d7d887787e96de",
|
|
86
|
+
"web/my/apps/placeholder/settings.html": "718b6f2125d4b89f7b1e81a193b2e37ef456a8dbdf730e44f9db1fc936e9208c",
|
|
87
|
+
"web/my/apps/placeholder/settings.txt": "1bff1879d6834916bb695bb8c9e2c4e635522729160f13b05b1ccefa4dead29e",
|
|
88
|
+
"web/my/apps.html": "f5bf33d493c9075eeb6dd06b3a8b3f20a641f7d81716c4687dfc6a173244af51",
|
|
89
|
+
"web/my/apps.txt": "ec9c46899c1c428ed54d77fe7a0cae2591063acc8c9a89349706496a9d88f6b6",
|
|
90
|
+
"web/my/dashboard.html": "d75f16b7304426242ad7eb6e4f96b5139e96a940194ffc1a2c18ce3c7e3d3873",
|
|
91
|
+
"web/my/dashboard.txt": "fb292274517d980d21bda02ff2e191fccf2354cd83a826667fd67390788b39a8",
|
|
92
|
+
"web/my/device-actions.html": "6b94e612247b9a1efc31c74494b8d1860981bb1ef52f720a842050e94099ae98",
|
|
93
|
+
"web/my/device-actions.txt": "1bbd96164282a185b66765d1024228cd4fefa7142e9e02bc157c480d455607bd",
|
|
94
|
+
"web/my/device-notifications.html": "daf52a46c69e73c8c78b846f04a12c988192b925943156be26048a020cd6138c",
|
|
95
|
+
"web/my/device-notifications.txt": "765ef7108ecafc1601aceafcfa8a3433bb5da7615cb4269399394627c0811318",
|
|
96
|
+
"web/my/favorites.html": "1df35f3a0484a0ed7414a003d417151fd9cdd748fcb4e0a390000934d9ed392c",
|
|
97
|
+
"web/my/favorites.txt": "715dca79f786369aa1913197b0ce741d9e23b9447d0ea5b83c87d60d9d469d6f",
|
|
98
|
+
"web/my/groups.html": "32ee26f7fbef222ca340f7d0841d8d9f491d064bf21386a3989db8aa9e5754dc",
|
|
99
|
+
"web/my/groups.txt": "81dbbab713894dfd84501a605bf31a0eff7b34ec29238d4a007ff1b2bf619d36",
|
|
100
|
+
"web/my/info.html": "518cf55c3ff1f8b58d95f680c7033b379f7bbfd34c3f89f2601670653dec8433",
|
|
101
|
+
"web/my/info.txt": "be4e983e077c6fbaf7c543792cf5bcb141d24cd51d32854f37722fe132b8113b",
|
|
102
|
+
"web/my/keys.html": "0d6821b0634c8023e4c58e32856404a3a128dcf9726ca57beeeb64d824f0e058",
|
|
103
|
+
"web/my/keys.txt": "277b2aa48289a585ae83e5f2ba766d55169d64a4bbbb09d8a3001f6208625080",
|
|
104
|
+
"web/my/orgs.html": "e97a708f677b22e8935eea89353d0fa6c75a426e746a5bd008561176a7d12d71",
|
|
105
|
+
"web/my/orgs.txt": "d51da8f671b9ff52ec4a9d2615f486023e32f2eec514f1e19f3eae87d8d53da5",
|
|
106
|
+
"web/my/pages.html": "1c91dee80bf4d8c8220e1393c9e597a7d6cfee9395dedbb1579bbad396e93a25",
|
|
107
|
+
"web/my/pages.txt": "5976bb9c3bec552f33be74681d1a8c374af53ac6e21782c3cfc3ae6bf9938705",
|
|
108
|
+
"web/my/peers.html": "229dbe0c6892fd32783c7fe19711f3d68e2a658f78abe7b018d25a507f607a24",
|
|
109
|
+
"web/my/peers.txt": "760c29954d11eb6233f17d31d2f137c9e5718795423db6f2f892e7444c264e27",
|
|
110
|
+
"web/my/recent.html": "436b76e70b4028ef0674490566c146b892238c79d31a8ca39830c65d93d1f1ff",
|
|
111
|
+
"web/my/recent.txt": "18cbf4e03ad5593ece368d5b62ae5fd9cbcbbd3309137f67aac09db368fd8863",
|
|
112
|
+
"web/my/settings.html": "f79faef2783fbae478b0a1f8d9a260871ac507e56c935c9e64127dd09b59e254",
|
|
113
|
+
"web/my/settings.txt": "49c948ef39a29d111d4ed4e52b66ca21ed95230c53e3f5cd5ac18f8ec15b7ea2",
|
|
114
|
+
"web/my/studio.html": "3f6e6ed15719402e73ddd67c737710383eaec64e2e7fcfb10e642bf3a278f8ac",
|
|
115
|
+
"web/my/studio.txt": "36e38ed722bb64d1a960117df2d76a8039129b5bd8a9b092d476eef275ef5bf3",
|
|
116
|
+
"web/my/subscriptions.html": "a3021f27f8dfd6a87b87d3b5cd7a2542130a0357bf7902cae7d91aea8f73cdc4",
|
|
117
|
+
"web/my/subscriptions.txt": "42904e81e07912cfadb8364ccc92bcaa675c27fff359966479ec2c2d6ec1d044",
|
|
118
|
+
"web/my/system.html": "1bbfcdca41dd2310f28d292a1fadab20f715eae541ec85807a8582ad15e34bd8",
|
|
119
|
+
"web/my/system.txt": "f39e0efe712e9358068bb1549177264cfec47925cfb71d7fdee9f9bd43701110",
|
|
120
|
+
"web/my/tasks.html": "05a645d7982447f448d5991053db053751adabba10a4e4c4f2be471d35959104",
|
|
121
|
+
"web/my/tasks.txt": "01187d8f4c6a03da5f244891dc530f2ca43c29e46735db5744eee58bbe1c8725",
|
|
122
|
+
"web/my/users.html": "e4bd6d03a4d0c2a58ac2e7a9cefe8b0464077d52236ee246e5d289cc075f4b9e",
|
|
123
|
+
"web/my/users.txt": "43b4dde924c4ccdf6fe6438b000c6473cbe4f46e228184a03cfb6ebb85b8cec0",
|
|
124
|
+
"web/my.html": "75aa42c7476f9fddf11733013b0d62ff6d25c4522f19ca17ed9d03b6b13db34a",
|
|
125
|
+
"web/my.txt": "06b864cfe6d83819739fec22b3e96e598b55460b458056fc197352d590d0b332",
|
|
126
|
+
"web/platform-shell/placeholder/placeholder.html": "156a194cfed8bb0f7f062ba213fd19ade938e7caea56786877865a23875c978a",
|
|
127
|
+
"web/platform-shell/placeholder/placeholder.txt": "7c2c3bddc727beec6fed48eba29ac855acc83b36ed670477abc6ac50841e3009",
|
|
128
|
+
"web/platform-shell-preview.html": "eb760b7b78c10e64c3f0361fc88e562b08d3501b39eb2013a1c91d43aab6a793",
|
|
129
|
+
"web/platform-shell-preview.txt": "6a6fd959485773d63e0f381c26276d505cb1712ae7c6c171cf1e19c2d5f2262d",
|
|
130
|
+
"web/setup.html": "ba781de007a65ac5a4e9a2355121fb34036bd29426cf79e9776a3852d5262a3a",
|
|
131
|
+
"web/setup.txt": "9eacb3e9bdc6d127ecb1cdee9fa41fdae6cc73a4df79193b972a917145c02fa1"
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -946,6 +946,12 @@ var require_runtime_errors = __commonJS({
|
|
|
946
946
|
exports2.summarizeError = summarizeError;
|
|
947
947
|
exports2.wrapDatabaseRuntimeError = wrapDatabaseRuntimeError;
|
|
948
948
|
exports2.wrapDatabaseContractError = wrapDatabaseContractError;
|
|
949
|
+
exports2.setSqlJsRuntimeStopHook = setSqlJsRuntimeStopHook;
|
|
950
|
+
exports2.isSqlJsRuntimeUnusable = isSqlJsRuntimeUnusable;
|
|
951
|
+
exports2.markSqlJsRuntimeUnusable = markSqlJsRuntimeUnusable2;
|
|
952
|
+
exports2.unusableSqlJsRuntimeError = unusableSqlJsRuntimeError;
|
|
953
|
+
exports2.assertSqlJsRuntimeUsable = assertSqlJsRuntimeUsable2;
|
|
954
|
+
exports2.resetSqlJsRuntimeUsability = resetSqlJsRuntimeUsability;
|
|
949
955
|
var LocalAppRuntimeError = class extends Error {
|
|
950
956
|
status;
|
|
951
957
|
code;
|
|
@@ -1005,6 +1011,43 @@ var require_runtime_errors = __commonJS({
|
|
|
1005
1011
|
}
|
|
1006
1012
|
});
|
|
1007
1013
|
}
|
|
1014
|
+
var sqlJsRuntimeStop;
|
|
1015
|
+
var sqlJsRuntimeStopReason;
|
|
1016
|
+
function setSqlJsRuntimeStopHook(hook) {
|
|
1017
|
+
sqlJsRuntimeStop = hook;
|
|
1018
|
+
}
|
|
1019
|
+
function isSqlJsRuntimeUnusable() {
|
|
1020
|
+
return sqlJsRuntimeStopReason !== void 0;
|
|
1021
|
+
}
|
|
1022
|
+
function markSqlJsRuntimeUnusable2(err, scope) {
|
|
1023
|
+
const fatal = new LocalAppRuntimeError(`The LocalApp SQLite runtime is unusable after a WebAssembly trap in ${scope}; the Server must restart`, {
|
|
1024
|
+
status: 503,
|
|
1025
|
+
code: "db_runtime_restart_required",
|
|
1026
|
+
cause: err,
|
|
1027
|
+
details: { scope, ...summarizeError(err) }
|
|
1028
|
+
});
|
|
1029
|
+
if (sqlJsRuntimeStopReason !== void 0)
|
|
1030
|
+
return fatal;
|
|
1031
|
+
sqlJsRuntimeStopReason = fatal.message;
|
|
1032
|
+
process.stderr.write(`[localapp] ${fatal.message} (${JSON.stringify(summarizeError(err))})
|
|
1033
|
+
`);
|
|
1034
|
+
if (sqlJsRuntimeStop) {
|
|
1035
|
+
sqlJsRuntimeStop(fatal.message);
|
|
1036
|
+
return fatal;
|
|
1037
|
+
}
|
|
1038
|
+
setImmediate(() => process.exit(1));
|
|
1039
|
+
return fatal;
|
|
1040
|
+
}
|
|
1041
|
+
function unusableSqlJsRuntimeError() {
|
|
1042
|
+
return new LocalAppRuntimeError("The LocalApp SQLite runtime is unusable after a WebAssembly trap; the Server must restart", { status: 503, code: "db_runtime_restart_required", details: {} });
|
|
1043
|
+
}
|
|
1044
|
+
function assertSqlJsRuntimeUsable2() {
|
|
1045
|
+
if (sqlJsRuntimeStopReason !== void 0)
|
|
1046
|
+
throw unusableSqlJsRuntimeError();
|
|
1047
|
+
}
|
|
1048
|
+
function resetSqlJsRuntimeUsability() {
|
|
1049
|
+
sqlJsRuntimeStopReason = void 0;
|
|
1050
|
+
}
|
|
1008
1051
|
}
|
|
1009
1052
|
});
|
|
1010
1053
|
|
|
@@ -1289,16 +1332,14 @@ var require_app_db = __commonJS({
|
|
|
1289
1332
|
return Buffer.from(db2.export());
|
|
1290
1333
|
});
|
|
1291
1334
|
}
|
|
1292
|
-
async function openDatabase(dbPath2
|
|
1335
|
+
async function openDatabase(dbPath2) {
|
|
1336
|
+
(0, runtime_errors_js_1.assertSqlJsRuntimeUsable)();
|
|
1293
1337
|
const SQL = await getSqlJs();
|
|
1294
1338
|
try {
|
|
1295
1339
|
const db2 = node_fs_1.default.existsSync(dbPath2) ? new SQL.Database(node_fs_1.default.readFileSync(dbPath2)) : new SQL.Database();
|
|
1296
1340
|
return guardDatabase2(dbPath2, db2);
|
|
1297
1341
|
} catch (err) {
|
|
1298
|
-
|
|
1299
|
-
resetSqlJsRuntimeAfterError();
|
|
1300
|
-
return openDatabase(dbPath2, false);
|
|
1301
|
-
}
|
|
1342
|
+
recoverFromSqlJsRuntimeError(dbPath2, err);
|
|
1302
1343
|
throw err;
|
|
1303
1344
|
}
|
|
1304
1345
|
}
|
|
@@ -1351,17 +1392,7 @@ var require_app_db = __commonJS({
|
|
|
1351
1392
|
if (!(0, runtime_errors_js_1.isWasmRuntimeError)(err))
|
|
1352
1393
|
return;
|
|
1353
1394
|
evictConnectionForDbPath(dbPath2);
|
|
1354
|
-
|
|
1355
|
-
}
|
|
1356
|
-
function resetSqlJsRuntimeAfterError() {
|
|
1357
|
-
for (const [dbPath2, entry] of _connections) {
|
|
1358
|
-
try {
|
|
1359
|
-
entry.db.close();
|
|
1360
|
-
} catch {
|
|
1361
|
-
}
|
|
1362
|
-
_connections.delete(dbPath2);
|
|
1363
|
-
}
|
|
1364
|
-
SqlJs2 = null;
|
|
1395
|
+
(0, runtime_errors_js_1.markSqlJsRuntimeUnusable)(err, "application database");
|
|
1365
1396
|
}
|
|
1366
1397
|
function markDirty(dbPath2) {
|
|
1367
1398
|
const entry = _connections.get(dbPath2);
|
|
@@ -7500,6 +7531,7 @@ function evictMetaDbAfterRuntimeError(err) {
|
|
|
7500
7531
|
current?.close();
|
|
7501
7532
|
} catch {
|
|
7502
7533
|
}
|
|
7534
|
+
(0, import_server_core.markSqlJsRuntimeUnusable)(err, "meta database");
|
|
7503
7535
|
}
|
|
7504
7536
|
function guardSqlJsCall(fn) {
|
|
7505
7537
|
try {
|
|
@@ -7511,6 +7543,7 @@ function guardSqlJsCall(fn) {
|
|
|
7511
7543
|
}
|
|
7512
7544
|
function assertMetaDatabaseAvailable() {
|
|
7513
7545
|
if (commitStateUnknown) throw commitStateUnknown;
|
|
7546
|
+
(0, import_server_core.assertSqlJsRuntimeUsable)();
|
|
7514
7547
|
}
|
|
7515
7548
|
function guardStatement(stmt) {
|
|
7516
7549
|
const target = stmt;
|