Skip to content

relay: subscription id length is measured three different ways #954

Open

Description

@chappie-daemon
  • decode (messages.rs): chars().count() — Unicode scalar values
  • REQ/COUNT handlers (subscribe.rs): .len() — UTF-8 bytes
  • TypeScript capture: UTF-16 units

With the shipped 256 limit, an id of 100 Chinese characters passes decoding (100) and is rejected by both handlers (300 bytes), although the capture accepts it.

Fix: encode_utf16().count() in all three, with non-ASCII cases in the tests.

Evidence: #948.

Activity

  1. added
    bug
    rewrite
    rust
    factory
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfactoryrewriterust

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions