Skip to content

fix(client): name the input limit in the autocomplete error - #11

Open
lui01212 wants to merge 2 commits into
gatepost-dev:mainfrom
lui01212:fix/autocomplete-input-limit-message
Open

lui01212 wants to merge 2 commits into
gatepost-dev:mainfrom
lui01212:fix/autocomplete-input-limit-message

Conversation

@lui01212

@lui01212 lui01212 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Give text over the input limit its own invalid_input message in autocompleteRequest.
Until now such text was turned into empty text, so the caller read "The text must hold 1 to 11
letters and digits after normalize", even when it held only a few letters and digits. The new
message names the 64 code point limit, like the PHP client does. The error code and the public
interface stay the same.

The new test fails on the old code with exactly that message, and passes after the fix.
pnpm check, Node 22 tests and the Firefox and WebKit journeys pass after the fix.

CI: https://github.com/lui01212/js/actions/runs/37894387274
Before the fix: https://github.com/lui01212/js/actions/runs/37893246517

Closes #5

Claude Code helped write the test, the fix and the changeset, and review the diff.

Signed-off-by: Lui Lui 40736418+lui01212@users.noreply.github.com

Text over 64 code points gets the "1 to 11 letters and digits" message
today, even when it holds only a few letters and digits after normalize.
Check that the message names the limit before changing it (T-1).

Signed-off-by: Lui Lui <40736418+lui01212@users.noreply.github.com>
Text over 64 code points was turned into empty text before the check, so
the caller read "1 to 11 letters and digits", which points at the wrong
fault. Refuse it with its own message first, like the PHP client does.

Signed-off-by: Lui Lui <40736418+lui01212@users.noreply.github.com>
@lui01212

Copy link
Copy Markdown
Contributor Author

Hi @MobileMage, a gentle nudge on this one when you have time. It pairs with gatepost-dev/spec#15, which names the same 64 code point limit in client.md. Happy to change anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Name the 64 code point limit in the autocomplete error message

1 participant