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

Follow /with/ links through message moves #1028

Open
chrisbobbe opened this issue Oct 26, 2024 · 0 comments · May be fixed by #1029
Open

Follow /with/ links through message moves #1028

chrisbobbe opened this issue Oct 26, 2024 · 0 comments · May be fixed by #1029
Labels
a-api Implementing specific parts of the Zulip server API a-msglist The message-list screen, except what's label:a-content
Milestone

Comments

@chrisbobbe
Copy link
Collaborator

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
@chrisbobbe chrisbobbe added a-msglist The message-list screen, except what's label:a-content a-api Implementing specific parts of the Zulip server API labels Oct 26, 2024
@chrisbobbe chrisbobbe added this to the Launch milestone Oct 26, 2024
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Oct 26, 2024
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-api Implementing specific parts of the Zulip server API a-msglist The message-list screen, except what's label:a-content
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant