fix: normalize smart quotes in function execution body - #3169
Merged
Conversation
Safari substitutes curly quotes while typing, which makes JSON bodies invalid (console#2872). Normalize typographic quotes on submit and disable spellcheck on the body textarea. Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
Console (appwrite/console)Project ID: Tip Silent mode disables those chatty PR comments if you prefer peace and quiet |
Contributor
Greptile SummaryThis PR repairs execution bodies containing smart JSON delimiters while preserving already-valid JSON and non-JSON text.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "fix: repair only curly double quotes in ..." | Re-trigger Greptile |
Address Greptile P1: unconditional normalization could rewrite intentional typographic quotes in valid JSON string values or plain-text bodies. Only normalize when the original body fails JSON.parse and the repaired body succeeds. Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
Narrow Greptile follow-up: JSON delimiters are double quotes, so leave apostrophes/single smart quotes untouched. Still only rewrite when the original body is invalid JSON and the repaired body parses. Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
ChiragAgg5k
approved these changes
Aug 19, 2026
ChiragAgg5k
left a comment
Member
There was a problem hiding this comment.
Verified on current main: the execution body is still sent as-typed with no spellcheck=false, and Safari/smart-quoted JSON still fails to parse at character 3. The repair helper only rewrites curly double quotes when the original body is invalid JSON and the repaired body parses. Tests and CI look good.
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.

What does this PR do?
Safari (and some editors) substitute curly/smart quotes while typing. That makes JSON execution bodies invalid (
FormatException/ unexpected character). Normalize typographic quotes to ASCII on submit and disable spellcheck on the body textarea.Fixes #2872
Test Plan
TZ=EST bun vitest run src/lib/helpers/string.test.tsRelated PRs and Issues