Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Community creation fails when ñ char is present in the title and the length is 30 chars #6032

Closed
noeliaSD opened this issue Jun 8, 2022 · 4 comments

Comments

@noeliaSD
Copy link
Contributor

noeliaSD commented Jun 8, 2022

Description

ñ char is considered as len 2 in some point and then the length of the community title exceeds the allowed one and it is not created.

Error logged:

DBG 2022-06-08 17:44:38.028+02:00 NewBE_callPrivateRPC                       topics="rpc" tid=849155 file=core.nim:20 rpc_method=wakuext_createCommunity
ERR 2022-06-08 17:44:38.030+02:00 rpc response error                         topics="rpc" tid=849155 file=core.nim:29 err="\nstatus-go error [methodName:wakuext_createCommunity, code:-32000, message:create-community: invalid name ]\n"
ERR 2022-06-08 17:44:38.030+02:00 Error creating community                   topics="community-service" tid=849155 file=service.nim:602 msg="\nstatus-go error [methodName:wakuext_createCommunity, code:-32000, message:create-community: invalid name ]\n"
@richard-ramos
Copy link
Member

This is because when dealing with utf8 characters we need to count runes instead of using length.
for example:

import "fmt"
import "unicode/utf8"
fmt.Println("ñ", len("ñ"), utf8.RuneCountInString("ñ"))  // ñ,  2, 1
fmt.Println("世界", len("世界"), utf8.RuneCountInString("世界"))  // 世界,  6, 2
import std/unicode
echo "ñ ", "ñ".len, ",", "ñ".runeLen # ñ 2,1
echo "世界 ", "世界".len, ",", "世界".runeLen # 世界 6,2

We need to fix status-go and/or desktop to validate the length of a string with rune count functions in any place we use normal string lengths

@iurimatias iurimatias added to analyze and removed bug Something isn't working Communities labels Jun 19, 2022
@iurimatias
Copy link
Member

the specs specify that it needs to be alpha numeric and can't support encodings for security reasons or at least that was the case for public channels, need to analyze this

@iurimatias
Copy link
Member

confirmed: we wouldn't be supporting this due to impersonation risks

@felicio
Copy link

felicio commented Jan 27, 2023

@iurimatias, please

the specs specify

Are you referring to status-im/feature-specs#42?

we wouldn't be supporting this due to impersonation risks

How do characters like these enable that and alphanumeric ones alone don't? For those risks I understood we're implementing the mechanisms mentioned in status-im/feature-specs#42 (comment).

Finally, will this limitation apply to display names of other entities like the community or channel, and to description as mentioned on the meeting about link sharing? If so, are you tracking it somewhere to address that?

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

No branches or pull requests

4 participants