Commit Graph

17 Commits

Author SHA1 Message Date
Evy Kassirer
66b90d3736 message: Create new LocalMessage to fix type of transmit.send_message. 2025-10-01 16:38:55 -07:00
Evy Kassirer
10a815cae7 stream_data: Rename add_sub to add_sub_for_tests. 2025-09-30 12:52:47 -07:00
Kislay Verma
67ca49488f tests: Use make_realm to create type-correct realm objects.
Another step in the direction of improving node tests
and using type-correct organic data as much as possible.
2025-08-28 11:35:07 -07:00
Vector73
a77fc6aa79 stream_settings: Add new disable_topics option to topics_policy.
Adds new configuration option `disable_topics` in `topics_policy`
channel setting to support disabling topics in the channel.

Fixes #34553.
2025-07-09 14:25:53 -07:00
Maneesh Shukla
52b83f7b58 topic_list: Filter topics by resolved state in "more topics" view.
Fixes: #24200.
2025-07-01 14:02:57 -07:00
Prakhar Pratyush
43249cb431 stream_topic_history_util: Add retry mechanism to get_server_history.
Earlier, in `get_server_history` the API call to fetch stream-topic
history didn't have a retry logic.

This commit adds a retry mechanism.

If the request to fetch stream topic history fails, we now retry
the request up to a fixed number of times before giving up.
This improves UX in case of temporary network issues.
2025-06-26 10:11:05 -07:00
Prakhar Pratyush
2bf13c36be test_stream_topic_history: Remove unused mock for people.ts.
This commit removes the unused mock for 'people.ts' in
'stream_topic_history.test.cjs'.
2025-06-26 10:11:05 -07:00
Prakhar Pratyush
7d55ad3c13 topic_list: Move and reorganize couple of functions to topic_list.ts.
A prep commit to move `is_complete_for_stream_id` and
`all_topics_in_cache` from `stream_topic_history` to `topic_list`
as it is specifically used while building topic list widget.

As it makes more sense to use `is_complete_for_stream_id` instead of
`all_topics_in_cache` directly, we reorganize to put it inside
`is_complete_for_stream_id`.

We rename `is_complete_for_stream_id` to
`is_full_topic_history_available` for clarity.

It'll also help to avoid tackling circular import issue
while resolving #28949.

No functional change in this commit.
2025-06-19 12:43:02 -07:00
Prakhar Pratyush
f94d3bd4a2 stream_topic_history: Use first_including_muted for the oldest message.
Earlier, we were using `all_messages_data.first()` for the oldest
message ID we have in cache, which is incorrect.

`all_messages_data.first_including_muted()` returns the oldest ID.

This commit fixes the bug.
2025-06-19 12:43:02 -07:00
bedo
465a0ef0d0 message_util: Rename "get_messages_in_topic".
Follow-up commit.

This renaming clearly conveys that
fetched messages are cached.
2025-05-19 00:08:29 -07:00
Sahil Batra
52b20354e6 message_view: Live update on losing access to a stream.
This commit adds code to live update the message view when
user loses access to a stream and also remove the data of
messages from that stream.
2025-04-29 09:46:19 -07:00
roanster007
41f30e1052 topics: Change topic links of left sidebar to use new permalinks.
This commit updates the topic links obtained from clicking
the topics in the left sidebar, recent view and inbox, and
those obtained from "Copy link to topic" to use the new
topic permalinks.

Fixes part of #21505.
2025-02-12 16:21:03 -08:00
Prakhar Pratyush
181572021d get_stream_topics: 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 `allow_empty_topic_name` boolean parameter to
`GET /users/me/{stream_id}/topics` endpoint to decide
whether the topic names in the fetched `topics` array
can be empty strings.

If False, the topic names in the fetched response will
have the value of `realm_empty_topic_display_name` field
in `POST /register` response replacing "".

Fixes part of #23291.
2025-01-22 15:54:11 -08:00
Prakhar Pratyush
fd67e31163 web: Add parameters to API requests for empty topic name support.
This commit adds `allow_empty_name: true` to the following
endpoints to receive empty strings as topic name when such
topics are available:
* `GET /messages`
* `GET /messages/{message_id}`
* `GET /messages/{message_id}/history`

Also, it adds `empty_topic_name` client capability for spectators.

These changes are part of the broader effort to enable
support for empty string as a topic name.
2025-01-10 14:32:55 -08:00
Aman Agrawal
525ae3aaff message_list: Fix message list missing messages.
Since we allow calling `add_messages` without checking fetch status,
it can lead to non-contiguous message history due to latest message
being added to a message list without previous messages being
fetched.

To fix it, we only allow adding new messages via message_fetch
which properly sets `anchor` to the last message in the list
before fetching and adding messages to the list.
2024-12-18 10:21:48 -08:00
Aman Agrawal
a97b3c7e41 conversation_participants: Track participants data in with message data.
This will help us accurately track participants in every narrow
to be used buddy list and other components.
2024-12-12 09:09:30 -08:00
Anders Kaseorg
687f1b1651 tests: Rename the Node tests to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00