dsh-unlag 1.9.6 → 1.9.7

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 +9 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1089,7 +1089,15 @@ function serveBundlesAtCurrentRevision(ctx) {
1089
1089
  */
1090
1090
  const wrapped = async (req, res) => {
1091
1091
  const originalUrl = String(req?.url ?? '')
1092
- const retargeted = retargetRevision(originalUrl, entryRevisionFor(clientModules.graph(), originalUrl))
1092
+ // Reading the table can throw while the plugin set is being swapped. This runs inside an async
1093
+ // route handler, where a rejection is an unhandled one and takes the whole app with it, so the
1094
+ // failure has to end here: answer the request as the table left it and say why in the log.
1095
+ let retargeted = null
1096
+ try {
1097
+ retargeted = retargetRevision(originalUrl, entryRevisionFor(clientModules.graph(), originalUrl))
1098
+ } catch (error) {
1099
+ log(`cannot read the plugin table for a bundle request: ${error?.message ?? error}`)
1100
+ }
1093
1101
  const realWriteHead = res.writeHead
1094
1102
  const realEnd = res.end
1095
1103
  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.7",
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",