-
Notifications
You must be signed in to change notification settings - Fork 230
fix: namespace #1549
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
fix: namespace #1549
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- sdks/typescript/package.json: Language not supported
|
||
// FIXME: the config loader is called twice so we get a double _ | ||
if (this.config.namespace) { | ||
this.config.namespace = this.config.namespace.replace('__', '_'); |
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.
Consider using a global replacement if there's a possibility of multiple double underscores in the namespace, e.g. using a regular expression like this.config.namespace.replace(/__+/g, '_').
this.config.namespace = this.config.namespace.replace('__', '_'); | |
this.config.namespace = this.config.namespace.replace(/__+/g, '_'); |
Copilot uses AI. Check for mistakes.
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.
no.
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.
what happens if someone makes their namespace matt__dev
or something?
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.
that's fair, let me move this up to the new client and remove the trailing underscore there
@@ -89,6 +89,12 @@ export class HatchetClient implements IHatchetClient { | |||
logger: logConstructor, | |||
}; | |||
|
|||
if (clientConfig.namespace) { | |||
clientConfig.namespace = clientConfig.namespace.endsWith('_') |
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.
@mrkaye97 this should be safer
Description
The nested client adds a _
Type of change