You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
"If a Japanese character is set as the subscriber ID and a REQ message is sent from the client to the relay, it will return ["NOTICE","ERROR: bad req: invalid character in subscription id"]."
To Reproduce
For example, sending ["REQ", "日本語のサブスクライバーID", {"kinds": 1, "limit": 10}] from the client to the relay.
Expected behavior
It is possible to use Japanese characters(and other language too) as the subscriber ID.
Additional context
For <subscription_id>, the following rules are defined in NIP-01.
<subscription_id>”<subscription_id> is an arbitrary, non-empty string of max length 64 chars, that should be used to represent a subscription.”
The specification for characters is not provided.
The text was updated successfully, but these errors were encountered:
Currently strfry is quite restrictive on what you can use a subscription ID. I can make it work with your string, but can I ask why you want to do this?
In my opinion, the best format for a subscription ID is just an increasing integer. For example, on the first subscription of the connection, use "1". On the second, use "2", etc. The counter can be reset on each connection (subscription IDs are local to a single connection).
Note in your case you are using a sub ID of 38 bytes. Every event that is sent echos this entire string back to you. For example, if you received 1000 events, this would be 38000 bytes of bandwidth wasted.
Personally, I think it makes sense to use meaningful strings of characters for subscription IDs. In that case, I thought it would be easier to understand if we could use strings from each language.
Describe the bug
"If a Japanese character is set as the subscriber ID and a REQ message is sent from the client to the relay, it will return ["NOTICE","ERROR: bad req: invalid character in subscription id"]."
To Reproduce
For example, sending ["REQ", "日本語のサブスクライバーID", {"kinds": 1, "limit": 10}] from the client to the relay.
Expected behavior
It is possible to use Japanese characters(and other language too) as the subscriber ID.
Additional context
For <subscription_id>, the following rules are defined in NIP-01.
<subscription_id>”<subscription_id> is an arbitrary, non-empty string of max length 64 chars, that should be used to represent a subscription.”
The specification for characters is not provided.
The text was updated successfully, but these errors were encountered: