Commit Graph

8 Commits

Author SHA1 Message Date
Anders Kaseorg e84bb9ff2c tests: Unmock state_data.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 15:34:58 -07:00
Anders Kaseorg ba8b9a445b eslint: Fix unicorn/prefer-node-protocol.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-08 16:54:15 -07:00
roanster007 81efecf463 stream_topic_history: Update history to only store acked message ids.
Previously, the "stream_topic_history" used to store unacked float
message ids as well in its "max_message_id" of stream and
"message_id" of topic histories.

This commit updates it to rather store only the acked message ids
here, and rather use the "echo_state" module so as to look up
for unacked messages in case of looking for recent topics, or
max message id in functions.
2024-10-02 18:31:32 -07:00
Aman Agrawal bb5c732dae stream_topic_history: Ask server for last msg id for historical topics.
Historical topics = Topics which we received from server and have
no messages cached for them to make any sense for the removed messages.
2024-06-30 22:37:46 -07:00
Aman Agrawal d2d479ba61 stream_topic_history: Fix wrong topic order when moving messages.
Fixes #27500

It is hard to reproduce the bug but this should fix any bugs
involving topic order when moving messages since we are updating
the data again from the server.
2024-06-27 14:59:45 -07:00
Evy Kassirer 6e902defba
node tests: Use noop helper function pattern in test files.
Some files already were using `noop` in place of `() => {}`.
It's both clearer what it means and is easier to type.
This updates all test files to fully use `noop`, and
adds a shared import from the test lib file.
2023-12-14 14:51:33 -08:00
Prakhar Pratyush 5b7014e7d6 server_history: Prevent concurrent requests for the same stream_id.
This commit updates the 'get_server_history' function to return
early if a request is already in progress for a given stream_id,
thus preventing concurrent requests for a single stream_id.

We maintain a set 'request_pending_stream_ids', which contains all
the stream IDs for whom requests are in progress.

Using this set, we return early.

Fixes #26915.
2023-10-09 11:17:03 -07:00
Anders Kaseorg cea1119423 node_tests: Move to web/tests.
This lets us simplify the long-ish ‘../../static/js’ paths, and will
remove the need for the ‘zrequire’ wrapper.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-23 16:04:17 -08:00