dsh-unlag 1.9.6 → 1.9.8

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.
Files changed (2) hide show
  1. package/index.js +16 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1049,7 +1049,13 @@ function serveBundlesAtCurrentRevision(ctx) {
1049
1049
  * names, because a chunk is served at its entry's revision and nowhere else.
1050
1050
  */
1051
1051
  const url = String(request?.url ?? '')
1052
- const retargeted = retargetRevision(url, entryRevisionFor(clientModules.graph(), url))
1052
+ // Same reason as the handler shape below: a rejection here is unhandled and ends the process.
1053
+ let retargeted = null
1054
+ try {
1055
+ retargeted = retargetRevision(url, entryRevisionFor(clientModules.graph(), url))
1056
+ } catch (error) {
1057
+ log(`cannot read the plugin table for a bundle request: ${error?.message ?? error}`)
1058
+ }
1053
1059
  const method = String(request?.method ?? 'GET').toUpperCase()
1054
1060
  let answer = null
1055
1061
  try {
@@ -1089,7 +1095,15 @@ function serveBundlesAtCurrentRevision(ctx) {
1089
1095
  */
1090
1096
  const wrapped = async (req, res) => {
1091
1097
  const originalUrl = String(req?.url ?? '')
1092
- const retargeted = retargetRevision(originalUrl, entryRevisionFor(clientModules.graph(), originalUrl))
1098
+ // Reading the table can throw while the plugin set is being swapped. This runs inside an async
1099
+ // route handler, where a rejection is an unhandled one and takes the whole app with it, so the
1100
+ // failure has to end here: answer the request as the table left it and say why in the log.
1101
+ let retargeted = null
1102
+ try {
1103
+ retargeted = retargetRevision(originalUrl, entryRevisionFor(clientModules.graph(), originalUrl))
1104
+ } catch (error) {
1105
+ log(`cannot read the plugin table for a bundle request: ${error?.message ?? error}`)
1106
+ }
1093
1107
  const realWriteHead = res.writeHead
1094
1108
  const realEnd = res.end
1095
1109
  const ask = async (url) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-unlag",
3
- "version": "1.9.6",
3
+ "version": "1.9.8",
4
4
  "type": "module",
5
5
  "description": "A press applies plugin edits right away and brings a laggy interface back; automatic reloading stays off unless you turn it on, so the press is the only trigger, and nothing restarts.",
6
6
  "license": "MIT",