:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(node): move the ml-mirror sidecar to node 26 types (#129584)
Georges-Antoine Assie853dfb02507
diff --git a/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/package.json b/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/package.jsonindex cf08bc9ab341..0b7affbf9a39 100644--- a/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/package.json+++ b/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/package.json@@ -35,7 +35,7 @@"@babel/preset-typescript": "^7.26.0","@types/express": "^4.17.21","@types/jest": "^29.5.14",- "@types/node": "^24.0.0",+ "@types/node": "^26.6.5","babel-jest": "^29.7.0","jest": "^29.7.0","oxfmt": "^0.35.0",diff --git a/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/pnpm-lock.yaml b/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/pnpm-lock.yamlindex 23b8930e8bb6..18799685c35f 100644--- a/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/pnpm-lock.yaml+++ b/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/pnpm-lock.yaml@@ -22,7 +22,7 @@ importers:version: 6.0.0sharp:specifier: ^0.35.3- version: 0.35.3(@types/[email protected])+ version: 0.35.3(@types/[email protected])tsx:specifier: ^4.19.2version: 4.22.4@@ -46,14 +46,14 @@ importers:specifier: ^29.5.14version: 29.5.14'@types/node':- specifier: ^24.0.0- version: 24.13.2+ specifier: ^26.6.5+ version: 26.6.6babel-jest:specifier: ^29.7.0version: 29.7.0(@babel/[email protected])jest:specifier: ^29.7.0- version: 29.7.0(@types/[email protected])+ version: 29.7.0(@types/[email protected])oxfmt:specifier: ^0.35.0version: 0.35.0@@ -1382,8 +1382,8 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==}- '@types/[email protected]':- resolution: {integrity: sha512-fRa09kZTgu8o71KFcDjUFuc7F+dEbZYZmkI0mg5YBTRs0yMKjYHsq/c0urDKeDb+D5qVgXOdFcuu+DZPKOITwA==}+ '@types/[email protected]':+ resolution: {integrity: sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==}'@types/[email protected]':resolution: {integrity: sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==}@@ -2580,8 +2580,8 @@ packages:engines: {node: '>=14.17'}hasBin: true- resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==}+ resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==}resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==}@@ -3648,7 +3648,7 @@ snapshots:'@jest/[email protected]':dependencies:'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6chalk: 4.1.2jest-message-util: 29.7.0jest-util: 29.7.0@@ -3661,14 +3661,14 @@ snapshots:'@jest/test-result': 29.7.0'@jest/transform': 29.7.0'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6ansi-escapes: 4.3.2chalk: 4.1.2ci-info: 3.9.0exit: 0.1.2graceful-fs: 4.2.11jest-changed-files: 29.7.0- jest-config: 29.7.0(@types/[email protected])+ jest-config: 29.7.0(@types/[email protected])jest-haste-map: 29.7.0jest-message-util: 29.7.0jest-regex-util: 29.6.3@@ -3693,7 +3693,7 @@ snapshots:dependencies:'@jest/fake-timers': 29.7.0'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6jest-mock: 29.7.0'@jest/[email protected]':@@ -3711,7 +3711,7 @@ snapshots:dependencies:'@jest/types': 29.6.3'@sinonjs/fake-timers': 10.3.0- '@types/node': 24.13.2+ '@types/node': 26.6.6jest-message-util: 29.7.0jest-mock: 29.7.0jest-util: 29.7.0@@ -3733,7 +3733,7 @@ snapshots:'@jest/transform': 29.7.0'@jest/types': 29.6.3'@jridgewell/trace-mapping': 0.3.31- '@types/node': 24.13.2+ '@types/node': 26.6.6chalk: 4.1.2collect-v8-coverage: 1.0.3exit: 0.1.2@@ -3803,7 +3803,7 @@ snapshots:'@jest/schemas': 29.6.3'@types/istanbul-lib-coverage': 2.0.6'@types/istanbul-reports': 3.0.4- '@types/node': 24.13.2+ '@types/node': 26.6.6'@types/yargs': 17.0.35chalk: 4.1.2@@ -3976,17 +3976,17 @@ snapshots:'@types/[email protected]':dependencies:'@types/connect': 3.4.38- '@types/node': 24.13.2+ '@types/node': 26.6.6'@types/[email protected]':dependencies:- '@types/node': 24.13.2+ '@types/node': 26.6.6'@types/[email protected]': {}'@types/[email protected]':dependencies:- '@types/node': 24.13.2+ '@types/node': 26.6.6'@types/qs': 6.15.1'@types/range-parser': 1.2.7'@types/send': 1.2.1@@ -4000,7 +4000,7 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 24.13.2+ '@types/node': 26.6.6'@types/[email protected]': {}@@ -4021,9 +4021,9 @@ snapshots:'@types/[email protected]': {}- '@types/[email protected]':+ '@types/[email protected]':dependencies:- undici-types: 7.18.2+ undici-types: 8.9.0'@types/[email protected]': {}@@ -4032,16 +4032,16 @@ snapshots:'@types/[email protected]':dependencies:'@types/mime': 1.3.5- '@types/node': 24.13.2+ '@types/node': 26.6.6'@types/[email protected]':dependencies:- '@types/node': 24.13.2+ '@types/node': 26.6.6'@types/[email protected]':dependencies:'@types/http-errors': 2.0.5- '@types/node': 24.13.2+ '@types/node': 26.6.6'@types/send': 0.17.6'@types/[email protected]': {}@@ -4274,13 +4274,13 @@ snapshots:dependencies:browserslist: 4.28.4- [email protected](@types/[email protected]):+ [email protected](@types/[email protected]):dependencies:'@jest/types': 29.6.3chalk: 4.1.2exit: 0.1.2graceful-fs: 4.2.11- jest-config: 29.7.0(@types/[email protected])+ jest-config: 29.7.0(@types/[email protected])jest-util: 29.7.0prompts: 2.4.2transitivePeerDependencies:@@ -4664,7 +4664,7 @@ snapshots:'@jest/expect': 29.7.0'@jest/test-result': 29.7.0'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6chalk: 4.1.2co: 4.6.0dedent: 1.7.2@@ -4684,16 +4684,16 @@ snapshots:- babel-plugin-macros- supports-color- [email protected](@types/[email protected]):+ [email protected](@types/[email protected]):dependencies:'@jest/core': 29.7.0'@jest/test-result': 29.7.0'@jest/types': 29.6.3chalk: 4.1.2- create-jest: 29.7.0(@types/[email protected])+ create-jest: 29.7.0(@types/[email protected])exit: 0.1.2import-local: 3.2.0- jest-config: 29.7.0(@types/[email protected])+ jest-config: 29.7.0(@types/[email protected])jest-util: 29.7.0jest-validate: 29.7.0yargs: 17.7.3@@ -4703,7 +4703,7 @@ snapshots:- supports-color- ts-node- [email protected](@types/[email protected]):+ [email protected](@types/[email protected]):dependencies:'@babel/core': 7.29.7'@jest/test-sequencer': 29.7.0@@ -4728,7 +4728,7 @@ snapshots:slash: 3.0.0strip-json-comments: 3.1.1optionalDependencies:- '@types/node': 24.13.2+ '@types/node': 26.6.6transitivePeerDependencies:- babel-plugin-macros- supports-color@@ -4757,7 +4757,7 @@ snapshots:'@jest/environment': 29.7.0'@jest/fake-timers': 29.7.0'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6jest-mock: 29.7.0jest-util: 29.7.0@@ -4767,7 +4767,7 @@ snapshots:dependencies:'@jest/types': 29.6.3'@types/graceful-fs': 4.1.9- '@types/node': 24.13.2+ '@types/node': 26.6.6anymatch: 3.1.3fb-watchman: 2.0.2graceful-fs: 4.2.11@@ -4806,7 +4806,7 @@ snapshots:dependencies:'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6jest-util: 29.7.0@@ -4841,7 +4841,7 @@ snapshots:'@jest/test-result': 29.7.0'@jest/transform': 29.7.0'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6chalk: 4.1.2emittery: 0.13.1graceful-fs: 4.2.11@@ -4869,7 +4869,7 @@ snapshots:'@jest/test-result': 29.7.0'@jest/transform': 29.7.0'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6chalk: 4.1.2cjs-module-lexer: 1.4.3collect-v8-coverage: 1.0.3@@ -4915,7 +4915,7 @@ snapshots:dependencies:'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6chalk: 4.1.2ci-info: 3.9.0graceful-fs: 4.2.11@@ -4934,7 +4934,7 @@ snapshots:dependencies:'@jest/test-result': 29.7.0'@jest/types': 29.6.3- '@types/node': 24.13.2+ '@types/node': 26.6.6ansi-escapes: 4.3.2chalk: 4.1.2emittery: 0.13.1@@ -4943,17 +4943,17 @@ snapshots:dependencies:- '@types/node': 24.13.2+ '@types/node': 26.6.6jest-util: 29.7.0merge-stream: 2.0.0supports-color: 8.1.1- [email protected](@types/[email protected]):+ [email protected](@types/[email protected]):dependencies:'@jest/core': 29.7.0'@jest/types': 29.6.3import-local: 3.2.0- jest-cli: 29.7.0(@types/[email protected])+ jest-cli: 29.7.0(@types/[email protected])transitivePeerDependencies:- '@types/node'- babel-plugin-macros@@ -5291,7 +5291,7 @@ snapshots:- [email protected](@types/[email protected]):+ [email protected](@types/[email protected]):dependencies:'@img/colour': 1.1.0detect-libc: 2.1.2@@ -5322,7 +5322,7 @@ snapshots:'@img/sharp-win32-arm64': 0.35.3'@img/sharp-win32-ia32': 0.35.3'@img/sharp-win32-x64': 0.35.3- '@types/node': 24.13.2+ '@types/node': 26.6.6dependencies:@@ -5476,7 +5476,7 @@ snapshots:- [email protected]: {}+ [email protected]: {}diff --git a/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/src/pool.ts b/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/src/pool.tsindex 3d648ea4186f..f2ac5a10009f 100644--- a/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/src/pool.ts+++ b/nodejs/src/ingestion/pipelines/sessionreplay/ml-mirror-image-scrub-sidecar/src/pool.ts@@ -214,7 +214,9 @@ export async function startPool(// A worker that dies takes any in-flight job with it, so fail that request rather than let it// hang until the consumer's timeout. Replacement is unconditional: a worker that dies while// idle carries no job to fail, and leaving it would shrink the pool with nothing to show it.- worker.on('error', (error) => retireAndReplace(index, slot, error))+ worker.on('error', (error) =>+ retireAndReplace(index, slot, error instanceof Error ? error : new Error(String(error)))+ )worker.on('exit', (code) => retireAndReplace(index, slot, new Error(`scrub worker exited with code ${code}`)))slot.readyAt = performance.now()slot.usable = true