Skip to content

fix(webhooks): use server-provided inboundUrl for copy on list page#973

Merged
eshurakov merged 1 commit intomainfrom
fix/webhook-list-copy-url-uses-user-id-for-org
Mar 10, 2026
Merged

fix(webhooks): use server-provided inboundUrl for copy on list page#973
eshurakov merged 1 commit intomainfrom
fix/webhook-list-copy-url-uses-user-id-for-org

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented Mar 10, 2026

Summary

  • The webhook list page's "Copy URL" button was constructing inbound URLs client-side using a local buildWebhookUrl helper that always used session.user.id and hardcoded the /inbound/user/ path prefix. For org webhooks, this produced URLs with the user's ID instead of the org's ID and the wrong path prefix (/inbound/user/ instead of /inbound/org/).
  • Fix: the webhookTriggers.list tRPC endpoint now includes inboundUrl in each trigger's response (computed server-side via buildInboundUrl, which correctly branches on organizationId vs userId). The list page component now reads trigger.inboundUrl directly instead of constructing URLs client-side. This matches the pattern already used by the admin webhook list and the details page.
  • Removed the now-unused buildWebhookUrl helper, useSession import, and encodeUserIdForPath import from WebhookTriggersListContent.tsx.

Verification

  • pnpm typecheck passes cleanly across all workspace projects

Visual Changes

N/A

Reviewer Notes

  • The admin list page (AdminWebhookTriggersList.tsx) already followed the correct pattern: its tRPC endpoint (admin.webhookTriggers.list) calls buildInboundUrl per trigger and returns inboundUrl in the response. This fix aligns the non-admin list endpoint to the same approach.
  • The details page was unaffected because it fetches via webhookTriggers.get, which already returned the server-computed inboundUrl.

The webhook list page was constructing inbound URLs client-side using a
hardcoded buildWebhookUrl helper that always used the current user's ID
and the /inbound/user/ path prefix. For org webhooks this produced
incorrect URLs containing the user ID instead of the org ID.

Fix: include inboundUrl in the webhookTriggers.list tRPC response
(matching the admin router pattern) and read it from the trigger data
on the client, eliminating the buggy client-side URL construction.
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented Mar 10, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src/app/(app)/cloud/webhooks/WebhookTriggersListContent.tsx
  • src/routers/webhook-triggers-router.ts

@eshurakov eshurakov merged commit 25e4287 into main Mar 10, 2026
18 checks passed
@eshurakov eshurakov deleted the fix/webhook-list-copy-url-uses-user-id-for-org branch March 10, 2026 09:29
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