fix(mobile-recorder): scope recorder control to its owner and keep Android recordings on stop failure

This commit is contained in:
Yun Chan 2026-09-28 00:54:01 +09:00
parent 72c4ddaefb
commit ace946d5c7
10 changed files with 1673 additions and 697 deletions

View file

@ -0,0 +1,20 @@
interface TalkAccountSession {
user: { id: string }
}
/**
* Identity of the signed-in account for Talk operations. It deliberately
* ignores the access token: supabase-js rotates it about hourly for the same
* user, and a rotation must not cancel or discard an in-flight reply.
*/
export function talkAccountKey(session: TalkAccountSession | null): string {
return session === null ? 'signed-out' : `user:${session.user.id}`
}
/** True when a result produced for `started` still belongs to the current account. */
export function isSameTalkAccount(
started: TalkAccountSession,
latest: TalkAccountSession | null,
): boolean {
return latest !== null && latest.user.id === started.user.id
}