Clarify member snapshot output and boundary test contracts

This commit is contained in:
evgeny committed 2026-10-27 10:44:53 +01:00
1 parent 6104086d5b
commit 2822fa53e3
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ extern "C" {
/* Получить всех мемберов канала в uasync. out/count обязательны; 0 — успех, -1 с логом.
* out — собственный u_malloc-массив count*CHAT_MEMBER_DISPLAY_SIZE, освобождается u_free;
* пустой список даёт NULL/0. Ошибка сохраняет NULL/0. Порядок: online первыми, затем uint64 node_id.
* пустой список даёт NULL/0. При корректных out/count ошибка даёт NULL/0. Порядок: online первыми, затем uint64 node_id.
* Это API не ограничено 16-битным count GUI-события; рост массива ограничен размером u_realloc. */
int chat_core_get_member_list(struct UTUN_INSTANCE* inst, const char* ch_id, uint8_t** out, int* count);
+1 -1
View File
@@ -37,7 +37,7 @@ static void snapshot_event(struct UTUN_INSTANCE* inst, int type, const uint8_t*
snapshot_last = count ? mf_get64(data + 7 + (size_t)(count - 1) * CHAT_MEMBER_DISPLAY_SIZE) : 0;
}
/* Настоящие SQLite-запрос/сериализатор/trampoline: count не должен оборачиваться и чистить GUI ложным снимком. */
/* Настоящие SQLite-запрос/сериализатор/trampoline: count должен соответствовать числу wire-записей. */
static int test_snapshot_event_bounds(struct UASYNC* ua) {
struct UTUN_INSTANCE inst; setup(&inst, ua);
struct chat_core_ctx cc = { .inst = &inst, .db = inst.topo_sqlite_db, .initialized = 1 };