fix: improve typings for urls and paths#4
Conversation
|
I let Claude Code review the PR. At least 1-4 do look like valid findings to my untrained eye. What do you say? At the end of the day, I'll of course merge this PR according to your preferences, so consider this review just a unsolicited public service. :-D Claude's ramblings below. ReviewThanks for picking this up. Overall direction — Blocking1. Hash/fragment dropped for path-only externalUrl (SPA-routing regression)
const result = buildUrl(new URL(`http://placeholder${this.integration.externalUrl}`), path, queryParams);
return `${result.pathname}${result.search}` as Path;When That was the entire reason
There's no test asserting hash preservation for the path-only case. Either restore the hash-preserving behavior, or explicitly decide hash-bang isn't supported — but that's a feature regression that deserves its own decision, not a side-effect of a typings refactor. 2. Broken test: null-externalUrl fallback
test("with null externalUrl should fallback to integration url", () => {
const integration = new FakeIntegration(undefined, undefined, {
externalUrl: null,
url: new URL("https://example.com"),
});
const result = integration.buildExternalUrl("/items/42", { q: "search" });
expect(result).toBe("https://example.com/items/42?q=search");
});The fallback in If tests are running green, that's evidence this test isn't actually executing. 3.
tRPC + SuperJSON does not transform This works today only because the two existing consumers do Options: keep wire types as Should fix4. Was Now This already forced a UX regression in ntfy.
Notification titles used to be e.g. If Options: (a) keep 5. Dead variable in
const topicURL = this.externalUrl(`/${notification.topic}`);
6. Type imports flagged by ESLint config
Many files do 7.
So precedence is Minor8.
9.
Given #1 and #3 in particular, this isn't mergeable as-is. Happy to take a follow-up stack on top if you'd rather land the typing direction first and address the regressions separately — let me know what you'd prefer. |
Homarr
Thank you for your contribution. Please ensure that your pull request meets the following pull request:
pnpm build, autofix withpnpm format:fix)devbranchx,y,ior any abbrevation)