npm package diff

Package: @forge/tunnel

Versions: 5.5.7-next.14 - 5.6.0-next.15

File: package/out/services/local-invocation-service.js

Index: package/out/services/local-invocation-service.js
===================================================================
--- package/out/services/local-invocation-service.js
+++ package/out/services/local-invocation-service.js
@@ -1,12 +1,14 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.LocalInvocationService = void 0;
+const tslib_1 = require("tslib");
 const util_1 = require("../util");
 const index_1 = require("../index");
 const uuid_1 = require("uuid");
 const runtime_1 = require("@forge/runtime");
 const cli_shared_1 = require("@forge/cli-shared");
+const zlib = tslib_1.__importStar(require("node:zlib"));
 const DEFAULT_INVOCATION_TIMEOUT = 25;
 class LocalInvocationService {
     configFile;
     logger;
@@ -56,15 +58,18 @@
             inspector: inspect ? this.inspector : undefined
         });
         clearTimeout(tunnelWarningTimeout);
         const reportMetrics = xenInvocationRequest.isFeatureFlagEnabled(runtime_1.XEN_RUNTIME_SHOULD_REPORT_METRICS);
-        LocalInvocationService.printMetrics(reportMetrics, metrics, this.logger);
+        LocalInvocationService.printMetrics(reportMetrics, metrics, metricsCompressed, this.logger);
         return reportMetrics ? { body, metrics, success, error, metricsCompressed } : body;
     }
     static INTERNAL_METRICS = ['execute.setup-request-context', 'invoke.setup-isolate'];
-    static printMetrics = (shouldReportMetrics, metrics, logger) => {
+    static printMetrics = (shouldReportMetrics, metrics, metricsCompressed, logger) => {
         if (shouldReportMetrics && metrics?.length) {
-            logger.debug(`Metrics: ${JSON.stringify(metrics.filter((m) => !LocalInvocationService.INTERNAL_METRICS.includes(m.name)), null, 2)}`);
+            if (metricsCompressed) {
+                metrics = JSON.parse(zlib.unzipSync(Buffer.from(metricsCompressed, 'base64')).toString());
+            }
+            logger.debug(`Metrics: ${JSON.stringify(metrics?.filter((m) => !LocalInvocationService.INTERNAL_METRICS.includes(m.name)), null, 2)}`);
         }
     };
 }
 exports.LocalInvocationService = LocalInvocationService;