Skip to content

Follow /with/ links through message moves #1028

Closed
@chrisbobbe

Description

@chrisbobbe

Narrow links with /with/<id> are the upcoming "topic permalink" feature:

These links look like:
https://chat.zulip.org/#narrow/channel/7-test-here/topic/Chris/with/1970220

Since #684, we accept and ignore the /with/<id> element. This issue is for using it as intended, i.e., opening the <id> message's current conversation even if that's different from the stream/topic in the link because it was moved.

We can include this element when requesting messages from the server. That's helpful because the work of finding the message's current conversation is all done on the server in a single round-trip. The server's get-messages result is from the <id> message's current conversation, if we have access to it.

From the API doc on constructing a narrow (what we call ApiNarrow in our code):

The with operator is designed to be used for permanent links to topics, which means they should continue to work when the topic is moved or resolved. If the message with the specified ID exists, and can be accessed by the user, then it will return messages with the channel/topic/dm operators corresponding to the current conversation containing that message, and replacing any such filters included in the narrow.

So, when the user taps a topic permalink, we should:

  • Open the message list, showing the link's stream/topic in the app bar (even if it might be stale)
  • When making the initial message-fetch request, include the "with" element
  • If the fetch result is from a different stream/topic than the one in the link, update the message list's narrow to the new stream/topic (which causes the app bar and other things to update)
  • In any case, update the message list's narrow so the "with" element isn't sent in fetch-older requests

Metadata

Metadata

Assignees

Labels

a-apiImplementing specific parts of the Zulip server APIa-msglistThe message-list screen, except what's label:a-contentserver-10Things new in Zulip Server 10.0

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions