Skip to content

Rule cases: a name of only a zero-width space - #52

Open
mvmorten wants to merge 1 commit into
mainfrom
tests/zero-width-space-case
Open

mvmorten wants to merge 1 commit into
mainfrom
tests/zero-width-space-case

Conversation

@mvmorten

Copy link
Copy Markdown
Owner

What changed

One new case in src/Web/src/customers/rule-cases.json: a name made of only U+200B (zero-width space). Neither side trims it, so both accept it and store it as is.

Why

A LinkedIn comment on post 11 suggested seeding the shared cases with more invisible characters. No-break spaces and the byte order mark were already there (U+00A0 around a name, a name of only U+FEFF). The zero-width space wasn't.

It's a different kind of case from the others. U+0085 and U+FEFF are where the two trims disagree; U+200B is where they agree, on something that looks empty but isn't. Neither .NET's char.IsWhiteSpace nor JavaScript's trim() counts it as white space. If one side ever starts stripping it (a "smarter" trim, a normalization step), this case fails on the other.

The case pins today's behavior; it doesn't argue it's the right behavior. Refusing invisible-only names would be a rule change on both sides, and a decision for later if it matters.

Build log

  • Added after the existing U+FEFF case, same shape (input, then stored). Prettier-clean.
  • npm test: 93 pass (was 92). The API side runs in CI's "Rule cases" step.
  • No code changed, so no /security-review and no screens to check.

Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0111pMFyGPdvdJq4M57N8mG6

This branch has not been deployed

No deployments
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.

2 participants