-
Notifications
You must be signed in to change notification settings - Fork 10.2k
fix: regex and id extraction for giphy media urls #22276
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
base: main
Are you sure you want to change the base?
Conversation
@abhix4 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic reviewed 1 file and found no issues. Review PR in cubic.dev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic reviewed 1 file and found no issues. Review PR in cubic.dev.
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (07/04/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (07/04/25)1 label was added to this PR based on Keith Williams's automation. |
if (!matches || matches.length < 2) { | ||
return res.status(400).json({ message: "Giphy URL is invalid" }); | ||
} | ||
const giphyId = matches[2]; | ||
const giphyId = matches[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this change?
WalkthroughThe changes update the regular expression used in the Giphy URL validation logic within Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were found. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.ts📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit Inference Engine (.cursor/rules/review.mdc)
Files:
🧠 Learnings (2)📓 Common learnings
packages/app-store/giphy/api/get.ts (1)Learnt from: Anshumancanrock 🔇 Additional comments (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This PR is being marked as stale due to inactivity. |
Making it draft. Feel free to rfr once the comments are addressed. |
What does this PR do?
Fixed the regular expression used for validation.
Correctly extracts the Giphy ID from the URL path.
Visual Demo (For contributors especially)
before:

after:

Mandatory Tasks (DO NOT REMOVE)
Summary by cubic
Fixed Giphy URL validation and ID extraction to correctly handle different Giphy media URL formats.