fix: drop avatarUrl from Maple webhook create payload#318
Merged
Conversation
The channelWebhook.create RPC validates avatarUrl by HEAD-fetching the URL and asserting Content-Type starts with image/. Brandfetch's CDN now serves a 302 redirect to its hotlinking guidelines (text/html) on direct hits, so passing the Brandfetch icon URL fails validation: defect: "Avatar URL must point to an image\n at [\"avatarUrl\"]" The webhook record's avatarUrl is only used as a fallback in the channel integrations settings list. The bot identity that actually appears on posted messages is resolved via WEBHOOK_BOT_CONFIGS.maple by IntegrationBotService.getOrCreateWebhookBotUser, which is unaffected by the create payload. Dropping the field unblocks creation without changing the rendered embed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @Makisuo's task —— View job PR Review Complete ✅I've completed a comprehensive review of this pull request. Here's my analysis: Todo List:
Review SummaryThis is a well-reasoned and safe fix for a specific validation issue. The change removes Code Quality: ✅ Excellent
Root Cause Analysis: ✅ CorrectThe issue stems from Brandfetch CDN changes:
Architecture Understanding: ✅ SolidThe fix correctly identifies the separation of concerns:
Security: ✅ No concerns
Performance: ✅ Improvement
Test Coverage:
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hazel-app | 4f525b8 | Commit Preview URL Branch Preview URL |
Apr 26 2026, 12:12 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Creating a Maple webhook from
/{org}/settings/integrations/maplefails with:```
{
"_tag": "Die",
"defect": "Avatar URL must point to an image\n at [\"avatarUrl\"]"
}
```
Root cause
The `channelWebhook.create` RPC validates `avatarUrl` by issuing an HTTP HEAD against the URL and asserting the response `Content-Type` starts with `image/` (packages/schema/src/avatar-url.ts:50). Brandfetch's CDN now redirects direct hits with `HTTP 302 → docs.brandfetch.com/.../hotlinking` (`text/html`), so the validator rejects the URL.
Fix
Drop `avatarUrl` from the create payload in maple-section.tsx. Two reasons this is safe:
Notes
<img>, no validation). If browsers also start blocking those, that's a separate UI fix.Test plan
/{org}/settings/integrations/maple→ click Add Channel → pick a channel → Connect Maple. Expect: webhook created, copy-URL panel appears, no "Avatar URL" error in the toast or console.🤖 Generated with Claude Code