8000 Fix error in trimTrailingSlash by laurakwhit · Pull Request #2559 · temporalio/ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix error in trimTrailingSlash #2559

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 1 commit into from
Feb 14, 2025
Merged

Fix error in trimTrailingSlash #2559

merged 1 commit into from
Feb 14, 2025

Conversation

laurakwhit
Copy link
Contributor

Description & motivation 💭

Seeing Sentry errors for trimTrailingSlash due to the argument being null. This PR checks for potentially null endpoint before calling trimTrailingSlash.

Screenshots (if applicable) 📸

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

Copy link
vercel bot commented Feb 14, 2025

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

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2025 4:34pm

@@ -4,7 +4,7 @@ import { persistStore } from '$lib/stores/persist-store';
import type { DataEncoderStatus } from '$lib/types/global';
import { has } from '$lib/utilities/has';

export const codecEndpoint = persistStore('endpoint', null, true);
export const codecEndpoint = persistStore<string>('endpoint', null, true);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wondering if we should consider enabling strictNullChecks?

Copy link
Contributor
@rossedfort rossedfort Feb 14, 2025

Choose a reason for hiding this comment

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

We probably should just not use null here, and use undefined instead

export const codecEndpoint = persistStore<string | undefined>('endpoint', undefined, true);

That way when we access $codecEndpoint it will be type safe. Although I see persistStore is explicitly typed to accept null as a default value, I'm not sure why that is.

Copy link
Contributor

Choose a reason for hiding this comment

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

(this is probably fine for now though)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah left it null for now as I didn't track down if there were any conditionals that relied on it being null or something like that. I turned on strictNullChecks just to see if we do this elsewhere and there were a bunch of places that popped up.

8000
@@ -4,7 +4,7 @@ import { persistStore } from '$lib/stores/persist-store';
import type { DataEncoderStatus } from '$lib/types/global';
import { has } from '$lib/utilities/has';

export const codecEndpoint = persistStore('endpoint', null, true);
export const codecEndpoint = persistStore<string>('endpoint', null, true);
Copy link
Contributor
@rossedfort rossedfort Feb 14, 2025

Choose a reason for hiding this comment

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

We probably should just not use null here, and use undefined instead

export const codecEndpoint = persistStore<string | undefined>('endpoint', undefined, true);

That way when we access $codecEndpoint it will be type safe. Although I see persistStore is explicitly typed to accept null as a default value, I'm not sure why that is.

@laurakwhit laurakwhit merged commit 22ecd45 into main Feb 14, 2025
15 checks passed
@laurakwhit laurakwhit deleted the fix-sentry-error branch February 14, 2025 17:10
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