-
Notifications
You must be signed in to change notification settings - Fork 205
fix: prevent Safari Smart Quotes from corrupting JSON in execution body (#11021) #2742
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
fix: prevent Safari Smart Quotes from corrupting JSON in execution body (#11021) #2742
Conversation
Fixes #10873 - Cannot read properties of undefined (reading 'smallIcon') When clicking 'Continue' on an existing web platform, the wizard was not receiving the framework key, causing selectedFramework to be undefined.
Console (appwrite/console)Project ID: Sites (1)
Tip HTTPS and SSL certificates are handled automatically for all your Sites |
WalkthroughThis pull request modifies the platform wizard initialization flow and a related UI component. Changes include: (1) disabling spellcheck on request body textarea fields in the function execution page, (2) threading an optional platform key parameter through the platform onboarding and continuation logic from the onboard component through the continuePlatform function call, and (3) refining conditional rendering in the web platform creation component to only display details when a framework is selected. Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (5)**/*.{ts,tsx,js,jsx,svelte}📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/routes/**/*.svelte📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx,svelte,json}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.svelte📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/routes/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (3)📚 Learning: 2025-11-19T11:22:42.553ZApplied to files:
📚 Learning: 2025-11-19T11:22:42.553ZApplied to files:
📚 Learning: 2025-11-25T03:15:27.539ZApplied to files:
🔇 Additional comments (3)
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 |
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.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/routes/(console)/project-[region]-[project]/overview/platforms/+page.svelte (1)
30-51: The key parameter handling issue is in createWeb.svelte, not wizard.start.While
wizard.starthandles the undefined key gracefully by passing it through props, theCreateWebcomponent does not handle this case. On line 160 of createWeb.svelte, the code derivesselectedFrameworkusingframeworks.find((framework) => framework.key === key), which will beundefinedif key is not provided. This causes a crash on line 231 when accessingselectedFramework.label.Since
continuePlatformis only called with existing platforms (where key exists), the risk is low in current usage. However, the optionalkey?parameter signature could lead to misuse. Consider either:
- Making
keyrequired in the function signature, or- Adding a null/undefined check in CreateWeb before accessing selectedFramework properties
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/onboard.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js,jsx,svelte}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx,svelte}: Import reusable modules from the src/lib directory using the $lib alias
Use minimal comments in code; reserve comments for TODOs or complex logic explanations
Use $lib, $routes, and $themes aliases instead of relative paths for module imports
Files:
src/routes/(console)/project-[region]-[project]/overview/onboard.sveltesrc/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
src/routes/**/*.svelte
📄 CodeRabbit inference engine (AGENTS.md)
Use SvelteKit file conventions: +page.svelte for components, +page.ts for data loaders, +layout.svelte for wrappers, +error.svelte for error handling, and dynamic route params in square brackets like [param]
Files:
src/routes/(console)/project-[region]-[project]/overview/onboard.sveltesrc/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
**/*.{ts,tsx,js,jsx,svelte,json}
📄 CodeRabbit inference engine (AGENTS.md)
Use 4 spaces for indentation, single quotes, 100 character line width, and no trailing commas per Prettier configuration
Files:
src/routes/(console)/project-[region]-[project]/overview/onboard.sveltesrc/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
**/*.svelte
📄 CodeRabbit inference engine (AGENTS.md)
Use Svelte 5 + SvelteKit 2 syntax with TypeScript for component development
Files:
src/routes/(console)/project-[region]-[project]/overview/onboard.sveltesrc/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
src/routes/**
📄 CodeRabbit inference engine (AGENTS.md)
Configure dynamic routes using SvelteKit convention with [param] syntax in route directory names
Files:
src/routes/(console)/project-[region]-[project]/overview/onboard.sveltesrc/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
🧠 Learnings (3)
📚 Learning: 2025-11-19T11:22:42.553Z
Learnt from: atharvadeosthale
Repo: appwrite/console PR: 2512
File: src/routes/(console)/project-[region]-[project]/overview/platforms/llmBanner.svelte:51-83
Timestamp: 2025-11-19T11:22:42.553Z
Learning: In src/routes/(console)/project-[region]-[project]/overview/platforms/llmBanner.svelte, the Lovable integration URL format `https://lovable.dev/` with `autosubmit` and `prompt` as query parameters (set via searchParams) is correct and functional.
Applied to files:
src/routes/(console)/project-[region]-[project]/overview/onboard.sveltesrc/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
📚 Learning: 2025-11-19T11:22:42.553Z
Learnt from: atharvadeosthale
Repo: appwrite/console PR: 2512
File: src/routes/(console)/project-[region]-[project]/overview/platforms/llmBanner.svelte:51-83
Timestamp: 2025-11-19T11:22:42.553Z
Learning: In src/routes/(console)/project-[region]-[project]/overview/platforms/llmBanner.svelte, the Cursor integration URL format `https://cursor.com/link/prompt` with the `text` query parameter is correct and functional.
Applied to files:
src/routes/(console)/project-[region]-[project]/overview/onboard.sveltesrc/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/+page.sveltesrc/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
📚 Learning: 2025-11-25T03:15:27.539Z
Learnt from: CR
Repo: appwrite/console PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T03:15:27.539Z
Learning: Applies to src/routes/**/*.svelte : Use SvelteKit file conventions: +page.svelte for components, +page.ts for data loaders, +layout.svelte for wrappers, +error.svelte for error handling, and dynamic route params in square brackets like [param]
Applied to files:
src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte
🔇 Additional comments (3)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.svelte (1)
179-183: LGTM! Fix correctly prevents Safari Smart Quotes corruption.The addition of
spellcheck={false}to both body textareas (v2 and v3 functions) effectively disables Safari's spell-checking suite, which includes the Smart Quotes auto-replacement feature that was causing JSON parsing errors. This is a clean, minimal fix that follows the existing pattern mentioned in the PR (rawVariableEditor.svelte).The trade-off of disabling spell-checking is acceptable for JSON input fields where preserving exact character input matters more than spelling corrections.
Also applies to: 293-297
src/routes/(console)/project-[region]-[project]/overview/platforms/createWeb.svelte (1)
337-351: LGTM: Conditional rendering now properly guards against undefined framework.The change from
{:else}to{:else if selectedFramework}ensures the Details block only renders when a framework is actually selected. This prevents displaying framework-specific UI whenkeydoesn't match any entry in theframeworksarray.src/routes/(console)/project-[region]-[project]/overview/onboard.svelte (1)
70-77: LGTM: Correctly passes platform key to updated API.The call to
continuePlatformnow includesplatform.keyas the fourth argument, properly aligning with the updated function signature in+page.svelte.

What does this PR do?
Fixes Safari's Smart Quotes issue in the Function Execution Body field.
When users type JSON (e.g.,
{ "test": "value" }) in the Body textarea on Safari/macOS, the browser's Smart Quotes feature automatically converts straight quotes (") to curly/typographic quotes (""), which are invalid JSON characters. This causes aFormatExceptionwhen trying to create the execution.Solution: Added
spellcheck={false}to both BodyInputTextareacomponents (for v2 and v3 functions). This disables Safari's spell-checking suite, which includes the Smart Quotes auto-replacement feature.This pattern is already used in rawVariableEditor.svelte in this codebase.
Test Plan
pnpm dev{ "test": "value" }") - no curly quotesAlso tested in Chrome/Firefox to ensure no regressions.
Related PRs and Issues
Have you read the Contributing Guidelines on issues?
Yes
Summary by CodeRabbit
Bug Fixes
New Features
UX Improvements
✏️ Tip: You can customize this high-level summary in your review settings.