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

[FIX]Renaming of channel breaks links/references. #13269

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

Kailash0311
Copy link
Contributor

Closes #7108.

@Kailash0311
Copy link
Contributor Author

I have fixed the issue but I am not able to change the unit tests accordingly.
Help appreciated. :)

@Kailash0311
Copy link
Contributor Author

Kailash0311 commented Feb 2, 2019

Since earlier, channel names were used in data-channel attribute in anchor tags around the channel mentioned(e.g #general), they could be directly be put in the unit tests, now we cannot do that.
Also since I am fetching from the database the room details( room._id ), which then become the value of data-channel, I cannot hard code.
And while testing RocketChat.models is recognized as undefined if we do not pass externalRoom as argument to the function replaceChannels and check if its defined and proceed with it.
I don't know if its the correct method, but its the best I could come up.

@Kailash0311
Copy link
Contributor Author

@sampaiodiego can you please help me with this? :)

@sampaiodiego
Copy link
Member

thanks @Kailash0311 .. let me ask for @tassoevan and @ggazzo to also take a look on this.

@Kailash0311 from what I've seen, if a channel is renamed, even though the mention links to it will keep working, they'll still show with the old name right? I'm thinking if this should be fixed like we do for usernames, but I'm not sure.

@Kailash0311
Copy link
Contributor Author

No the link won't work once it has been renamed.
Issue ( #7108 ) that I am solving is exactly that :)

@tassoevan
Copy link
Contributor

@Kailash0311, I'm not sure if I've understood the resolution here. If I send a message like

Please look at #channel-a

and then rename channel-a as channel-b and create a new channel named channel-a, how would my message look like?

@Kailash0311
Copy link
Contributor Author

Kailash0311 commented Feb 4, 2019

@tassoevan I don't think your message would change at all but your message would be directed to the new channel (which was not intended I suppose.)
My resolution is that if we link channel-id ( which is now channel-name) with the channel mention we can still redirect to the old channel which was probably intended at the time of the mention.
I didn't think of changing the message because we need to see all the messages to see if that channel was mentioned and then change it, which can be tedious task.

@tassoevan tassoevan requested a review from ggazzo February 5, 2019 17:11
@Kailash0311
Copy link
Contributor Author

@tassoevan @sampaiodiego your comments on my resolution ?
I'll be happy to change if anything is wrong(or missing) in my code.

@Kailash0311 Kailash0311 changed the title mentions: Replace name by id in data-channel. [FIX]Renaming of channel breaks links/references. May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renaming of channel breaks links/references
5 participants