mirror of
https://github.com/zulip/zulip.git
synced 2026-07-06 21:18:58 +08:00
Some checks are pending
Code scanning / CodeQL (push) Waiting to run
Zulip production suite / Ubuntu 22.04 production build (push) Waiting to run
Zulip production suite / ${{ matrix.name }} (zulip/ci:bookworm, --test-custom-db, Debian 12 production install with custom db name and user, bookworm) (push) Blocked by required conditions
Zulip production suite / ${{ matrix.name }} (zulip/ci:jammy, , Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga, jammy) (push) Blocked by required conditions
Zulip production suite / ${{ matrix.name }} (zulip/ci:noble, , Ubuntu 24.04 production install, noble) (push) Blocked by required conditions
Zulip production suite / ${{ matrix.name }} (zulip/ci:bookworm-7.0, 7.0 Version Upgrade, bookworm) (push) Blocked by required conditions
Zulip production suite / ${{ matrix.name }} (zulip/ci:bookworm-8.0, 8.0 Version Upgrade, bookworm) (push) Blocked by required conditions
Zulip production suite / ${{ matrix.name }} (zulip/ci:jammy-6.0, 6.0 Version Upgrade, jammy) (push) Blocked by required conditions
Zulip production suite / ${{ matrix.name }} (zulip/ci:noble-9.0, 9.0 Version Upgrade, noble) (push) Blocked by required conditions
Zulip CI / ${{ matrix.name }} (zulip/ci:bookworm, true, false, Debian 12 (Python 3.11, backend + documentation), bookworm) (push) Waiting to run
Zulip CI / ${{ matrix.name }} (zulip/ci:jammy, false, true, Ubuntu 22.04 (Python 3.10, backend + frontend), jammy) (push) Waiting to run
Zulip CI / ${{ matrix.name }} (zulip/ci:noble, false, false, Ubuntu 24.04 (Python 3.12, backend), noble) (push) Waiting to run
This commit extracts the "waiting_for_id" and "waiting_for_ack" data structures of "echo.js" into a separate module in "echo_state". This is a preparatory commit so as to be able to use them for "stream_topic_history" module, without causing import cycles.
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import type {Message} from "./message_store";
|
|
|
|
const waiting_for_id = new Map<string, Message>();
|
|
let waiting_for_ack = new Map<string, Message>();
|
|
|
|
export function set_message_waiting_for_id(local_id: string, message: Message): void {
|
|
waiting_for_id.set(local_id, message);
|
|
}
|
|
|
|
export function set_message_waiting_for_ack(local_id: string, message: Message): void {
|
|
waiting_for_ack.set(local_id, message);
|
|
}
|
|
|
|
export function get_message_waiting_for_id(local_id: string): Message | undefined {
|
|
return waiting_for_id.get(local_id);
|
|
}
|
|
|
|
export function get_message_waiting_for_ack(local_id: string): Message | undefined {
|
|
return waiting_for_ack.get(local_id);
|
|
}
|
|
|
|
export function remove_message_from_waiting_for_id(local_id: string): void {
|
|
waiting_for_id.delete(local_id);
|
|
}
|
|
|
|
export function remove_message_from_waiting_for_ack(local_id: string): void {
|
|
waiting_for_ack.delete(local_id);
|
|
}
|
|
|
|
export function _patch_waiting_for_ack(data: Map<string, Message>): void {
|
|
// Only for testing
|
|
waiting_for_ack = data;
|
|
}
|