fix(mobile-recorder): scope recorder control to its owner and keep Android recordings on stop failure
This commit is contained in:
parent
72c4ddaefb
commit
ace946d5c7
10 changed files with 1673 additions and 697 deletions
20
apps/mobile-rn/src/features/talk/talk-account.ts
Normal file
20
apps/mobile-rn/src/features/talk/talk-account.ts
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue