-
-
Notifications
You must be signed in to change notification settings - Fork 671
Convert from names to stream IDs to identify streams #3918
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
Comments
The Subscription object has both a stream name and a stream ID, and so to keep the test data well-formed these should be kept aligned in referring to the same stream. Similarly the Message object. Right now to make the test pass it's enough to set the stream name, because we don't use the stream ID; but that's a case of zulip#3918 and should change, after which the mismatch will be a live cause of test failures. We could do this by passing a stream object to `eg.makeSubscription` and to `eg.streamMessage`. But the most natural one to use is `eg.stream`; and the example data already refers to `eg.stream` by default in all the natural places, among them `eg.streamMessage()` and `eg.subscription`, so simply use that.
The Subscription object has both a stream name and a stream ID, and so to keep the test data well-formed these should be kept aligned in referring to the same stream. Similarly the Message object. Right now to make the test pass it's enough to set the stream name, because we don't use the stream ID; but that's a case of zulip#3918 and should change, after which the mismatch will be a live cause of test failures. We could do this by passing a stream object to `eg.makeSubscription` and to `eg.streamMessage`. But the most natural one to use is `eg.stream`; and the example data already refers to `eg.stream` by default in all the natural places, among them `eg.streamMessage()` and `eg.subscription`, so simply use that.
The Subscription object has both a stream name and a stream ID, and so to keep the test data well-formed these should be kept aligned in referring to the same stream. Similarly the Message object. Right now to make the test pass it's enough to set the stream name, because we don't use the stream ID; but that's a case of zulip#3918 and should change, after which the mismatch will be a live cause of test failures. We could do this by passing a stream object to `eg.makeSubscription` and to `eg.streamMessage`. But the most natural one to use is `eg.stream`; and the example data already refers to `eg.stream` by default in all the natural places, among them `eg.streamMessage()` and `eg.subscription`, so simply use that.
This commit removes stream name as a parameter to functions related to `TopicActionSheet` and instead introduces stream_id in its place. Stream ID is a better parameter since it always remains constant and many of the functions present in action sheet were already dependent on stream_id. Related: zulip#3918
This commit removes stream name as a parameter to functions related to `TopicActionSheet` and instead introduces stream_id in its place. Stream ID is a better parameter since it always remains constant and many of the functions present in action sheet were already dependent on stream_id. Related: zulip#3918
This also involved changing the call to `deleteMessagesForTopic` appropriately. The change is done to facilitate migration to `stream_id` instead of stream name for identifying streams. Related: zulip#3918
This commit removes stream name as a parameter to functions related to `TopicActionSheet` and instead introduces streamId in its place. Stream ID is a better parameter since it always remains constant. Related: zulip#3918
This also involved changing the call to `deleteMessagesForTopic` appropriately. The change is done to facilitate migration to `stream_id` instead of stream name for identifying streams. Related: zulip#3918
This commit removes stream name as a parameter to functions related to `TopicActionSheet` and instead introduces streamId in its place. Stream ID is a better parameter since it always remains constant. Related: zulip#3918
This also involved changing the call to `deleteMessagesForTopic` appropriately. The change is done to facilitate migration to `stream_id` instead of stream name for identifying streams. Related: zulip#3918
This commit removes stream name as a parameter to functions related to `TopicActionSheet` and instead introduces streamId in its place. Stream ID is a better parameter since it always remains constant. Related: zulip#3918
This also involved changing the call to `deleteMessagesForTopic` appropriately. The change is done to facilitate migration to `stream_id` instead of stream name for identifying streams. Related: zulip#3918
This commit removes stream name as a parameter to functions related to `TopicActionSheet` and instead introduces streamId in its place. Stream ID is a better parameter since it always remains constant. Related: zulip#3918
This also involved changing the call to `deleteMessagesForTopic` appropriately. The change is done to facilitate migration to `stream_id` instead of stream name for identifying streams. Related: zulip#3918
This commit removes stream name as a parameter to functions related to `TopicActionSheet` and instead introduces streamId in its place. Stream ID is a better parameter since it always remains constant. Related: zulip#3918
This also involves changing the call to `deleteMessagesForTopic` appropriately. The change is done as a step to migrate to using `stream_id` instead of stream name for identifying streams. Related: zulip#3918
This also involves changing the call to `deleteMessagesForTopic` appropriately. The change is done as a step to migrate to using `stream_id` instead of stream name for identifying streams. Related: zulip#3918
This also involves changing the call to `deleteMessagesForTopic` appropriately. The change is done as a step to migrate to using `stream_id` instead of stream name for identifying streams. Related: zulip#3918
This also involves changing the call to `deleteMessagesForTopic` appropriately. The change is done as a step to migrate to using `stream_id` instead of stream name for identifying streams. Related: zulip#3918
No, unfortunately -- those were just the instances that had specific tasks at the time. #4333 is the biggest remaining instance of this -- we identify narrows by stream name rather than stream ID. It connects to other instances which may not have specific tasks in our tracker. #3998 will help, giving us stream IDs on Outbox values. That will let various code that consumes those -- especially all the code that consumes |
The victory condition for this issue is basically: if you try removing the One quick approximation to that is to grep for So I think at this point the sequence for resolving this issue will be:
|
OK, with #5205 merged, this is now indeed mostly done! I went and looked through the codebase for remaining places where we're using the name of a stream. This meant searching the code for the patterns The results were:
For the places that need server support, I'll want to make sure that
Then when those are the only remaining uses of stream names that should be IDs, I think it may be time to declare victory on this issue. We'll get to the |
This represents one of the last significant pieces left for zulip#3918.
This represents one of the last significant pieces left for #3918.
Our goal in this series isn't yet to resolve the issue zulip#3918, but to get to where it's easy to *audit* our code for the remaining things we need to do to complete it. There are two kinds of searches one wants to do in such an audit: (a) Searching for *known* instances of the issue, in order to find remaining items to work on and eventually to confirm there are none left. For this, we want simple systematic patterns to search for. (b) Searching for yet-*unknown* instances of the issue. This is inherently fuzzier; one searches for patterns like /stream.name/ or /streamName/ or even /stream.*name/i to try to find code that refers to stream names, which produce a lot of matches including some legitimate uses and some that aren't even about stream names. For this, the main thing we can do is make it as simple as possible when reading such search results to confirm that a given spot is a known instance of the issue, in order to focus on those that might be unknown. For the sake of (a), we add TODO-3918 comments at each instance that's actionable on its own, and references to zulip#3918 where there's another TODO comment that the fix blocks on. For the sake of (b), when a given instance of the issue pops up in a number of scattered places (like the definition and each call site of a given function that takes a stream name), we add references to zulip#3918 at each of those places even when we only need one TODO comment. This commit adds such comments for two related instances of the issue, and the next few commits will add them for others.
Or in some cases, there's an existing TODO-server comment, and we just add a reference to the issue. (These are places where there's nothing to be done about the issue before simply dropping support for older servers, so the proper thing for the TODO itself to refer to is the server version.) I believe this covers all remaining instances of zulip#3918. That means that every place we refer to a stream name should either: * be a legitimate use of stream names; * have a TODO-3918 comment; or * have a different kind of TODO comment (as it happens, always a TODO-server comment), and a mention of zulip#3918. As a result, a search like `git grep TODO..3918` will find all the remaining places we need to act in order to close issue zulip#3918, according to the plan I described here: zulip#3918 (comment) The broader search `git grep -w 3918` will additionally find all the places that are (known) instances of the issue but are blocked purely on server upgrades.
Our goal in this series isn't yet to resolve the issue #3918, but to get to where it's easy to *audit* our code for the remaining things we need to do to complete it. There are two kinds of searches one wants to do in such an audit: (a) Searching for *known* instances of the issue, in order to find remaining items to work on and eventually to confirm there are none left. For this, we want simple systematic patterns to search for. (b) Searching for yet-*unknown* instances of the issue. This is inherently fuzzier; one searches for patterns like /stream.name/ or /streamName/ or even /stream.*name/i to try to find code that refers to stream names, which produce a lot of matches including some legitimate uses and some that aren't even about stream names. For this, the main thing we can do is make it as simple as possible when reading such search results to confirm that a given spot is a known instance of the issue, in order to focus on those that might be unknown. For the sake of (a), we add TODO-3918 comments at each instance that's actionable on its own, and references to #3918 where there's another TODO comment that the fix blocks on. For the sake of (b), when a given instance of the issue pops up in a number of scattered places (like the definition and each call site of a given function that takes a stream name), we add references to #3918 at each of those places even when we only need one TODO comment. This commit adds such comments for two related instances of the issue, and the next few commits will add them for others.
Or in some cases, there's an existing TODO-server comment, and we just add a reference to the issue. (These are places where there's nothing to be done about the issue before simply dropping support for older servers, so the proper thing for the TODO itself to refer to is the server version.) I believe this covers all remaining instances of #3918. That means that every place we refer to a stream name should either: * be a legitimate use of stream names; * have a TODO-3918 comment; or * have a different kind of TODO comment (as it happens, always a TODO-server comment), and a mention of #3918. As a result, a search like `git grep TODO..3918` will find all the remaining places we need to act in order to close issue #3918, according to the plan I described here: #3918 (comment) The broader search `git grep -w 3918` will additionally find all the places that are (known) instances of the issue but are blocked purely on server upgrades.
This got filed as a server issue: zulip/zulip#21015. There's now a draft API change and backend implementation: zulip/zulip#21251. |
Here's also a quote from my description of #5268 which closed this issue. It's an update of my comment above from a month before it was closed, explaining the status of the followup work and how it's tracked separately from this issue:
|
This is a meta-issue which covers a large number of independent tasks. Filing it in order to have a place to point to refer to the overall effort.
This is parallel to #3764, but for streams. Just like users can change their email addresses, streams can have their names changed, and so the permanent, numeric stream IDs are a better way to refer to a stream.
Most of the discussion in #3764 applies to this as well.
Tasks for specific instances of this include #3244, and #2760 which we fixed last summer.
The text was updated successfully, but these errors were encountered: