Repository navigation
fix(studio): encode special characters in trigger/function cross-link search params - #45851
Conversation
… search params TriggerList, EventTriggerList, and FunctionList build cross-links between the triggers and functions pages by interpolating user-controlled identifiers into the URL query string. Names or schemas containing &, =, +, or # corrupt the destination filter and route to the wrong row. Adds getDatabaseFunctionsHref to TriggerList.utils (used by both Trigger lists) and a new getDatabaseTriggersHref in FunctionList.utils, both with encodeURIComponent wraps. Replaces the three inline interpolations. Same pattern as supabase#45385. FunctionList only has a single search param (no schema) because the link filters by the function name only, so its helper takes one less argument.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
@oniani1 is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe PR fixes URL encoding issues in cross-links between database functions and triggers pages. Two new utility functions centralize URL construction with proper parameter encoding: ChangesDatabase Cross-link URL Builders
🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Braintrust eval report
|
Closes #45850.
Summary
TriggerList,EventTriggerList, andFunctionListbuilt cross-links between the database triggers and functions pages by interpolating user-controlled identifiers directly into the URL query string. A function or schema name containing&,=,+, or#corrupted the destination filter and routed users to the wrong row.Adds
getDatabaseFunctionsHreftoTriggerList.utils(used by bothTriggerListandEventTriggerList) and a newgetDatabaseTriggersHrefinFunctionList.utils, both withencodeURIComponentwraps. Replaces the three inline interpolations.FunctionListonly has a single search param (no schema) because the link filters by function name only, so its helper takes one less argument.Same pattern as #45385.
Test plan
Added
TriggerList.utils.test.tscoveringgetDatabaseFunctionsHref(plain, special chars in name, special chars in schema, both, undefined inputs) andFunctionList.utils.test.tscoveringgetDatabaseTriggersHref(plain, special chars in name, plus signs and spaces, undefined inputs). Nine tests total.Summary by CodeRabbit
Refactor
Tests