sdk-typescript icon indicating copy to clipboard operation
sdk-typescript copied to clipboard

Special behaviour for temporal prefixes

Open THardy98 opened this issue 11 months ago • 2 comments

What was changed

Special behavior handling reserved temporal prefixes. Prevent users from:

  • registering workflows, activities, task queues, signals/updates/queries with a reserved prefix
  • calling default handlers with reserved names
  • calling internal queries without going through interceptors

This change makes the reserved metrics names reserved across all entities (workflows, activities, signals, etc..).


Checklist

Some remaining items:

  • need to reserving prefixes from workflows,
  • waiting for default update handler to be merged to prevent default update handler to be called with reserved names
  1. Closes #1599

  2. How was this tested: unit/integration tests

  3. Any docs updates needed? I'm not sure.

THardy98 avatar Mar 11 '25 02:03 THardy98

In this change, users are prevented from registering signals/updates/queries with reserved names from the handler.

Users can still defineQuery, defineSignal, defineUpdate that have reserved names. The reason for this is because we use defineQuery to create the reserved queries ourselves.

Alternatively, we can do the blocking in define<X> and create our internal queries/signals/updates using internal functions. Or we can do both (blocking in the define and the handler). I picked one because it seemed sufficient.

THardy98 avatar Mar 11 '25 02:03 THardy98

this is blocked on https://github.com/temporalio/sdk-typescript/pull/1640 so we can handle the same prefix cases for updates as well

THardy98 avatar Mar 25 '25 18:03 THardy98

I had to also remove usage of the __temporal_logger sink in our internal tests, as well as in the deprecated defaultSinks() stub.

mjameswh avatar Aug 01 '25 16:08 mjameswh