Import apps/android/src/services/bot-room-rows.ts

This commit is contained in:
QQ 2026-11-17 08:30:27 +08:00
parent f4d74d7c7b
commit e35274d3a1
1 changed files with 5 additions and 5 deletions

View File

@ -66,12 +66,12 @@ export const ROOM_ROWS_LEGACY_INTERVAL_MS = 2000
export const ROOM_ROWS_LEGACY_MISSES = 2
/**
* Which rows a ledger line draws. The live snapshot wins only while it holds replies:
* a list captured just as the round opened is empty and knows nothing the rows fetched
* for the settled round do not, so letting it win hid the members' replies.
* A successful Host read is authoritative, including an empty result. The cached
* live snapshot may contain only the first member's reply from an earlier poll.
* Keep that snapshot only until the current round has been read successfully.
*/
export function preferredRoomRows(live: BotObject[] | undefined, fetched: BotObject[]): BotObject[] {
return live !== undefined && live.length > 0 ? live : fetched
export function preferredRoomRows(live: BotObject[] | undefined, fetched: BotObject[] | undefined): BotObject[] {
return fetched ?? live ?? []
}
function isObject(value: unknown): value is BotObject {