8000 fix: namespace by grutt · Pull Request #1549 · hatchet-dev/hatchet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 3 commits into from
Apr 14, 2025
Merged

fix: namespace #1549

merged 3 commits into from
Apr 14, 2025

Conversation

grutt
Copy link
Contributor
@grutt grutt commented Apr 14, 2025

Description

The nested client adds a _

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@grutt grutt requested review from mrkaye97 and Copilot April 14, 2025 22:06
Copy link
vercel bot commented Apr 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hatchet-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2025 10:21pm
hatchet-v0-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2025 10:21pm

Copy link
Contributor
@Copilot Copilot AI left a 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('__', '_');
Copy link
Preview
Copilot AI Apr 14, 2025

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, '_').

Suggested change
this.config.namespace = this.config.namespace.replace('__', '_');
this.config.namespace = this.config.namespace.replace(/__+/g, '_');

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no.

Copy link
Contributor

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?

Copy link
Contributor Author

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('_')
Copy link
Contributor Author

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

@grutt grutt merged commit e01e473 into main Apr 14, 2025
11 checks passed
@grutt grutt deleted the fix--ts-namespace-underscore branch April 14, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0