-
Notifications
You must be signed in to change notification settings - Fork 138
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3b3a6d5
init impl for special behaviour for temporal prefixes. Default signal…
THardy98 0d05950
improvements
THardy98 8237158
special prefix behaviour, does not cover workflows
THardy98 efe9d69
formatting & linting
THardy98 dfb0244
remove timeout
THardy98 55c641f
fix test timeout failure
THardy98 12062bc
Merge branch 'main' into handle_temporal_builtin_prefixes
mjameswh 73823fa
add checks for sinks, simplify reserved name checking, improve names
THardy98 3a8683a
Merge branch 'main' into handle_temporal_builtin_prefixes
THardy98 059e3b6
skip interceptors for future internal updates/signals
THardy98 66d9456
Merge branch 'main' into handle_temporal_builtin_prefixes
THardy98 d686105
move sink check, change constant var name
THardy98 ac5b8f3
Remove bypass on reserved sink names
mjameswh 59ad0b7
Remove all use of __temporal_logger in internal tests
mjameswh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| export const TEMPORAL_RESERVED_PREFIX = '__temporal_'; | ||
| export const STACK_TRACE_QUERY_NAME = '__stack_trace'; | ||
| export const ENHANCED_STACK_TRACE_QUERY_NAME = '__enhanced_stack_trace'; | ||
|
|
||
| /** | ||
| * Valid entity types that can be checked for reserved name violations | ||
| */ | ||
| export type ReservedNameEntityType = 'query' | 'signal' | 'update' | 'activity' | 'task queue' | 'sink' | 'workflow'; | ||
|
|
||
| /** | ||
| * Validates if the provided name contains any reserved prefixes or matches any reserved names. | ||
| * Throws a TypeError if validation fails, with a specific message indicating whether the issue | ||
| * is with a reserved prefix or an exact match to a reserved name. | ||
| * | ||
| * @param type The entity type being checked | ||
| * @param name The name to check against reserved prefixes/names | ||
| */ | ||
| export function throwIfReservedName(type: ReservedNameEntityType, name: string): void { | ||
| if (name.startsWith(TEMPORAL_RESERVED_PREFIX)) { | ||
| throw new TypeError(`Cannot use ${type} name: '${name}', with reserved prefix: '${TEMPORAL_RESERVED_PREFIX}'`); | ||
| } | ||
|
|
||
| if (name === STACK_TRACE_QUERY_NAME || name === ENHANCED_STACK_TRACE_QUERY_NAME) { | ||
| throw new TypeError(`Cannot use ${type} name: '${name}', which is a reserved name`); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.