status-mobile icon indicating copy to clipboard operation
status-mobile copied to clipboard

Uppercase channels cannot be tagged

Open Horupa-Olena opened this issue 8 months ago • 7 comments

Bug Report

Reproduction

  1. Log in to the app.
  2. Navigate to a #general channel in community
  3. Try to tag a channel that has an uppercase name (e.g., #Test).

Expected behavior

The channel should be properly tagged and appear as a clickable mention.

Actual behavior

The channel is not tagged, and the mention does not work.

Channel list Tag in channel
Image Image

Additional Information

  • Status version: nightly
  • Operating System: Android, iOS

Horupa-Olena avatar Apr 02 '25 08:04 Horupa-Olena

I've just started looking into this issue. It appears to be a status-go issue, and as a result, it's also present on Desktop (tested on the latest release: 2.33.2).

Findings

From my investigation, I found that the markdown parser's validation for status-tag (community channel tags) only recognizes lowercase alphabets. So, if a channel name contains any uppercase letters, it won't be recognized properly.

Relevant code:
https://github.com/status-im/markdown/blob/b7e33c6ac3d46410fbcfead2310fbc33a822a276/parser/parser.go#L694-L696

func isValidStatusTagChar(c byte) bool {
  return isNum(c) || isLowerCaseLetter(c) || c == '-' || c == '_'
}

Experiment

I tried modifying the validation logic by updating the condition to:

return isNum(c) || isLetter(c) || c == '-' || c == '_'

With this change, new channel mentions that include uppercase letters started getting recognized correctly.

Open Question

Should we:

  • Restrict users from creating channels with uppercase letters?
  • Or allow them and update the mention parser to handle uppercase characters as well?

Looking forward to input on the desired direction.

If the solution is to fix the mention logic, I'm not entirely sure about the full flow. Even after updating the parser code, the fix only applies to new messages - existing ones remain unaffected. I'm not sure how to handle previously sent messages. Any pointers on this would be helpful.

ajayesivan avatar May 13 '25 07:05 ajayesivan

@ajayesivan Thank you for your investigation! I'm just a QA, but maybe @qfrank and @ilmotta could provide you with some answers.

Horupa-Olena avatar May 15 '25 08:05 Horupa-Olena

@ajayesivan @Horupa-Olena I found the PR that introduced these markdown parser changes long ago https://github.com/status-im/markdown/pull/2 and the status-mobile issue https://github.com/status-im/status-mobile/issues/11317 doesn't explain why uppercase chars shouldn't be allowed.

Maybe @flexsurfer, @Samyoul, @churik know why uppercase chars are disallowed?

ilmotta avatar May 15 '25 13:05 ilmotta

mention only works for user identity/name, do we need to support channel name as well? @ilmotta

qfrank avatar May 19 '25 01:05 qfrank

@qfrank I believe the term used for channel names is status-tag / StatusTag.

Currently, the app supports tagging channel names and allows users to navigate to the corresponding channel by clicking on the tagged name in a message. However, this doesn’t work when the channel name contains uppercase letters, due to how the current logic is implemented in the parser.

That said, we're not entirely sure why uppercase letters aren't supported. If there's no specific reason for this limitation, we could consider allowing uppercase channel names as well.

Hope this helps clarify things a bit!

ajayesivan avatar May 19 '25 03:05 ajayesivan

@ilmotta wow, you found a very old issue!

I think they are not relevant now, as it was about public channels - we do not have them anymore. So the question is more to @jrainville or someone who is more familiar with status-go limitations on community channel names. Personally I do not see here any issue, but would be nice to hear it from status-go experts

churik avatar May 19 '25 11:05 churik

@churik @ajayesivan, I asked a question in Discord to status-go folks to see if anybody would be able to uncover the mystery https://discord.com/channels/1210237582470807632/1217172931197800468/1373922323693834250

As of now, there's nothing of substance and we need to wait more until other CCs engage. The outcome I'm leaning towards is to not allow channels to be created with uppercase chars and keep the markdown parser as is. But this won't solve the problem entirely, just for channels created after the fix.

It does seem (given the lack of context in the old issues above) that the choice was arbitrary and not based on a technical constraint. Tags with uppercase chars can be nice for readability purposes too.

ilmotta avatar May 19 '25 12:05 ilmotta