{"record":{"id":"5eb59b0f264136cc","repo":"apache/beam","slug":"timers-not-yet-supported","errorCode":null,"errorMessage":"Timers not yet supported.","messagePattern":"Timers not yet supported\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/worker/data.ts","lineNumber":135,"sourceCode":"    const this_ = this;\n    return {\n      sendData: function (data: Uint8Array) {\n        this_.dataChannel.write({\n          data: [\n            {\n              instructionId: bundleId,\n              transformId: transformId,\n              data: data,\n              isLast: false,\n            },\n          ],\n          timers: [],\n        });\n        return Promise.resolve();\n      },\n      sendTimers: function (timerFamilyId: string, timers: Uint8Array) {\n        // Should never get here if we never send timers.\n        throw Error(\"Timers not yet supported.\");\n      },\n      close: function () {\n        this_.dataChannel.write({\n          data: [\n            {\n              instructionId: bundleId,\n              transformId: transformId,\n              data: new Uint8Array(),\n              isLast: true,\n            },\n          ],\n          timers: [],\n        });\n      },\n      onError: function (error: Error) {\n        throw error;\n      },\n    };","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/worker/data.ts#L117-L153","documentation":"The TypeScript Beam worker's data layer creates a channel whose sendTimers method is a stub. Timers were never sent to this channel by design (the comment: 'Should never get here if we never send timers'), so any call is treated as an internal invariant violation and throws.","triggerScenarios":"A pipeline/transform registered a timer (via setTimer from the transform API) while the data channel was built without timer support, causing sendTimers to be invoked during bundle execution.","commonSituations":"Using the experimental TypeScript SDK with a pipeline that uses stateful DoFns with timers; a runner/worker combination where timer channels were not wired up; SDK limitation not yet implemented.","solutions":["Remove timer usage (windowed state/timers) from the TypeScript pipeline until supported.","Check for an SDK/runner upgrade that adds timer support and use it.","If timers are required, implement the pipeline in the Python/Java SDK instead."],"exampleFix":"// before (inside a stateful DoFn)\nthis.setTimer(\"expiry\", ...); // unsupported in TS worker data channel\n// after\n// drop the timer; use window-triggered logic or process in a Java/Python pipeline","handlingStrategy":"validation","validationCode":"// guard: don't register timers when targeting the TS worker\nconst useTimers = /* feature flag */ false;\nif (useTimers) throw new Error(\"Timers unsupported in TS worker; use Java/Python SDK\");","typeGuard":null,"tryCatchPattern":"try {\n  await runPipeline(p);\n} catch (e) {\n  if (e.message === \"Timers not yet supported.\") {\n    // fall back to non-timer pipeline design\n  }\n}","preventionTips":["Check SDK feature support docs before using stateful timers in the TypeScript SDK.","Pin pipeline design to windowing-only behavior in TS.","Keep a Java/Python fallback for timer-dependent transforms."],"tags":["typescript","beam","worker","timers","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}