devdep update, log async context loss
[websub-hub] / src / service.js
index d77d06c7794819967478df957afe0cfea7e0bbee..2bd57b0c1a704a0f22b8229a8438779f63bdf28f 100644 (file)
@@ -79,11 +79,13 @@ class Service extends Dingus {
   async preHandler(req, res, ctx) {
     await super.preHandler(req, res, ctx);
     const logObject = this.asyncLocalStorage.getStore();
-    // FIXME: for some reason, returning from the super.preHandler loses async context?
+    // FIXME: for some reason, returning from the super.preHandler sometimes loses async context?
     // Workaround until cause and solution are found.
     if (logObject) {
       logObject.requestId = ctx.requestId;
       delete ctx.requestId;
+    } else {
+      this.logger.debug(_fileScope('preHandler'), 'lost async context', { req, ctx });
     }
   }