initial_state_data: Add support for empty topic name.

This commit is a part of the work to support empty string
as a topic name.

Previously, empty string was not a valid topic name.

Adds backward compatibility for topic names in `unread_msgs`
objects returned in `/register` response.
This commit is contained in:
Prakhar Pratyush
2024-11-26 15:54:24 +05:30
committed by Tim Abbott
parent 0eea8bb4ac
commit 398b8b11db
9 changed files with 101 additions and 16 deletions

View File

@@ -845,7 +845,7 @@ class FetchInitialStateDataTest(ZulipTestCase):
user_profile=reader,
realm=reader.realm,
)
post_process_state(reader, result, False)
post_process_state(reader, result, False, True)
self.assert_length(result["unread_msgs"]["streams"], 1)
self.assertEqual(result["unread_msgs"]["streams"][0]["topic"], "case DOES not MATTER")
self.assert_length(result["unread_msgs"]["streams"][0]["unread_message_ids"], 2)