mirror of https://github.com/zulip/zulip.git
messages: Require join with zerver_message if use_first_unread_anchor.
This fixes a 500 bug where the RN mobile app would simply fail to load old messages if use_first_unread_anchor was not set.
This commit is contained in:
parent
ee2e6a31b1
commit
aa7e4fec35
|
@ -540,7 +540,7 @@ def get_old_messages_backend(request, user_profile,
|
||||||
if include_history and not use_first_unread_anchor:
|
if include_history and not use_first_unread_anchor:
|
||||||
query = select([column("id").label("message_id")], None, table("zerver_message"))
|
query = select([column("id").label("message_id")], None, table("zerver_message"))
|
||||||
inner_msg_id_col = literal_column("zerver_message.id")
|
inner_msg_id_col = literal_column("zerver_message.id")
|
||||||
elif narrow is None:
|
elif narrow is None and not use_first_unread_anchor:
|
||||||
query = select([column("message_id"), column("flags")],
|
query = select([column("message_id"), column("flags")],
|
||||||
column("user_profile_id") == literal(user_profile.id),
|
column("user_profile_id") == literal(user_profile.id),
|
||||||
table("zerver_usermessage"))
|
table("zerver_usermessage"))
|
||||||
|
|
Loading…
Reference in New Issue