-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Renaming a stream does not preserve links #4713
Comments
Hello @zulip/server-streams members, this issue was labeled with the area: stream settings label, so you may want to check it out! |
What would happen when some other streams takes the old name of the other stream? |
Wow, thanks for the quick feedback! I described this case in the issue:
Does this make sense? |
Ah, missed that part. Makes sense 👍 |
The default strategy I'd probably take with this is the same that we currently use for PM threads, basically putting the ID of the object into the URL: https://chat.zulip.org/#narrow/pm-with/857-joshuapan8 So we'd be doing here e.g. https://chat.zulip.org/#narrow/stream/123125-A I don't think that change would be super difficult to implement. Downsides include: Thoughts? I think that this model is probably simpler than making a |
Thanks @timabbott ! I should have read this earlier :-)
Yeah, that's the part that breaks my use case (preserving historical links from the FHIR issue tracker, mailing list, etc). I wound up taking a naive stab at something more like the There are challenging bits that I haven't tried, like updating the client-side rename list when stream names change while the client is running (thought it's vaguely possible this works correctly, given that the server-side tests pass). My sense is it's probably less work to throw this out and start something new (since 95% of my effort was understanding the codebase), but not sure whether I'll have the time for it. I'll send along a PR for what's there. |
OK, now that I have some tests in place and have figured out where to hook the logic into the frontend, I'm much happier with this. If it's getting close enough to be at all plausible for inclusion in 1.6 @timabbott that'd be awesome (but otherwise we can always deploy in FHIR's fork). |
I think this is a bit ambitious to get into 1.6, which we're hoping to release pretty soon. I definitely like some of the ideas here:
We should probably discuss this on chat. |
I like the last solution. |
This commit prefixes stream names in urls with stream ids, so that the urls don't break when we rename streams. strean name: foo bar.com% before: #narrow/stream/foo.20bar.2Ecom.25 after: #narrow/stream/20-foo-bar.2Ecom.25 For new realms, everything is simple under the new scheme, since we just parse out the stream id every time to figure out where to narrow. For old realms, any old URLs will still work under the new scheme, assuming the stream hasn't been renamed (and of course old urls wouldn't have survived stream renaming in the first place). The one exception is the hopefully rare case of a stream name starting with something like "99-" and colliding with another stream whose id is 99. The way that we enocde the stream name portion of the URL is kind of unimportant now, since we really only look at the stream id, but we still want a safe encoding of the name that is mostly human readable, so we now convert spaces to dashes in the stream name. Also, we try to ensure more code on both sides (frontend and backend) calls common functions to do the encoding. Fixes zulip#4713
One of the amazing things about renaming a github repo, or moving a github repo to a different organization, is that old links (web links + git remotes) keep working after the transition.
It would be delightful if Zulip did something similar when streams were renamed. My expectation is that if you renamed a stream A to B, visiting /#narrow/stream/A would redirect to /#narrow/stream/B. If someone then re-created a new A, the redirect would no longer apply.
I don't have a good sense of how challenging this would be to implement :-)
The text was updated successfully, but these errors were encountered: