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
    bugSomething isn't working
    rewritenostream 4.0 Rust/LMDB rewrite
    rustRust implementation work
    factoryBuilt by the software 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

    bugSomething isn't workingfactoryBuilt by the software factoryrewritenostream 4.0 Rust/LMDB rewriterustRust implementation work

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions