-
Notifications
You must be signed in to change notification settings - Fork 134
Special behaviour for temporal prefixes #1644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In this change, users are prevented from registering signals/updates/queries with reserved names from the handler. Users can still Alternatively, we can do the blocking in |
8170bc5
to
5f5103a
Compare
this is blocked on #1640 so we can handle the same prefix cases for updates as well |
… test needs to be fixed, need to add behaviour reserving prefixes from workflows, and waiting for default update to be merged to add behaviour preventing default update handler to be called with reserved names
5f5103a
to
8237158
Compare
1a7b249
to
55c641f
Compare
9eb4558
to
452602f
Compare
452602f
to
73823fa
Compare
d5428a3
to
059e3b6
Compare
@@ -1440,3 +1455,232 @@ test('Workflow can return root workflow', async (t) => { | |||
t.deepEqual(result, 'empty test-root-workflow-length'); | |||
}); | |||
}); | |||
|
|||
const reservedNames = [TEMPORAL_RESERVED_PREFIX, STACK_TRACE_RESERVED_NAME, ENHANCED_STACK_TRACE_RESERVED_NAME]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with what's here, but just giving some suggestions how you could have made those tests simpler:
- It's not really important either the error message is "... with reserved prefix" or "... which is a reserved name", so you could have simply made that a regexp, like:
{ name: 'TypeError', message: /Cannot use activity name: .*/ }
- In the
reservedNames
array, you could have included__temporal_test
(the composed form), instead of only the prefix; then, in tests below, you would no longer need thename === TEMPORAL_RESERVED_PREFIX ? name + '_test' : name
expression.
da9d57d
to
d686105
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one last thing, but fixed it myself.
Should be ready to merge now, just waiting for CI.
I had to also remove usage of the |
What was changed
Special behavior handling reserved temporal prefixes. Prevent users from:
Note: this change does not cover handling reserved temporal prefixes for workflows, as it involves non-trivial changes to the workflow bundling.
Closes [Feature Request] Special behavior for Temporal built-in prefixes #1599
How was this tested:
unit/integration tests
Any docs updates needed?
I'm not sure.