Skip to content

Voice · Repositories

6 modules · 22 exports · 1 repository · 0 e2e tests · 4 routes

Every table a function queries, its own helpers included, read or written. Calls to other repositories are listed apart, their tables are on their own page.

VoiceRepository

app/features/voice/VoiceRepository.server.ts
Tables
ChatRoomGroupGroupMatchGroupMemberUserUserSubmittedImageVoiceClientErrorVoiceFeedbackVoiceSessionVoiceSettings
Calls
no other repositories
Imports
no other modules
Used by
1 loader1 action3 routes2 modules1 routine1 other

Functions & values

function

findSettings

no JSDoc:19
export async function findSettings()
function

sumParticipantMinutesSince

no JSDoc:32
export async function sumParticipantMinutesSince(since: number)
Unit tests (3)
function

hasFeedbackSince

no JSDoc:48
export async function hasFeedbackSince({
	userId,
	since,
}: {
	userId: number;
	since: number;
})
function

hasBeenKicked

no JSDoc:65
export async function hasBeenKicked({
	roomId,
	userId,
}: {
	roomId: number;
	userId: number;
})
Unit tests (1)
function

findOwnSessionById

no JSDoc:83
export function findOwnSessionById(id: number)
function

findDailyAdoptionSince

no JSDoc:97
export function findDailyAdoptionSince(since: number)
Unit tests (1)
function

findPlayerAdoptionSince

no JSDoc:143
export function findPlayerAdoptionSince(since: number)
Unit tests (1)
function

findVoiceChatPreferenceStatsSince

no JSDoc:204
export function findVoiceChatPreferenceStatsSince(since: number)
function

findVoiceChatPreferences

no JSDoc:229
export function findVoiceChatPreferences(userIds: number[])
TablesUser
function

findPlatformStatsSince

no JSDoc:239
export function findPlatformStatsSince(since: number)
function

countLeaveReasonsSince

no JSDoc:283
export function countLeaveReasonsSince(since: number)
function

countClientErrorsSince

no JSDoc:297
export function countClientErrorsSince(since: number)
function

findLatestClientErrors

no JSDoc:310
export function findLatestClientErrors()
function

countRatingsSince

no JSDoc:327
export function countRatingsSince(since: number)
function

findLatestFeedbackComments

no JSDoc:340
export function findLatestFeedbackComments()
function

insertOwnSession

no JSDoc:364
export async function insertOwnSession(
	args: Pick<
		TablesInsertable["VoiceSession"],
		"roomId" | "roomType" | "platform" | "eligibleMemberCount" | "vcPreference"
	>,
)
Unit tests (1)
function

markOwnSessionConnected

no JSDoc:388
export async function markOwnSessionConnected({
	id,
	dailySessionId,
}: {
	id: number;
	dailySessionId: string;
})
function

updateOwnSessionSummary

no JSDoc:404
export async function updateOwnSessionSummary({
	id,
	...summary
}: Pick<
	Tables["VoiceSession"],
	"id" | "lowQualitySeconds" | "talkSeconds" | "inputMode"
>)
function

markOwnSessionLeft

no JSDoc:419
export async function markOwnSessionLeft({
	id,
	leaveReason,
}: {
	id: number;
	leaveReason: VoiceLeaveReason;
})
Unit tests (2)
function

markSessionsLeft

:436

Ends the users open sessions of the room, for when they are taken out of the call rather than leaving it.

export async function markSessionsLeft({
	roomId,
	userIds,
	leaveReason,
}: {
	roomId: number;
	userIds: number[];
	leaveReason: Extract<VoiceLeaveReason, "KICKED" | "EJECTED">;
})
function

hasOtherConnectedSession

:457

Whether the user is in the rooms call through a Daily session other than the given one, like after rejoining.

export async function hasOtherConnectedSession({
	roomId,
	userId,
	dailySessionId,
}: {
	roomId: number;
	userId: number;
	dailySessionId: string;
})
Unit tests (1)
function

updateFromLeftWebhook

no JSDoc:479
export async function updateFromLeftWebhook({
	dailySessionId,
	durationSeconds,
	networkQualityState,
	leftAt,
}: {
	dailySessionId: string;
	durationSeconds: number;
	networkQualityState: Tables["VoiceSession"]["networkQualityState"];
	leftAt: number;
})
Unit tests (2)
function

insertOwnClientError

no JSDoc:505
export async function insertOwnClientError(
	args: Omit<TablesInsertable["VoiceClientError"], "userId" | "createdAt">,
)
function

insertOwnFeedback

no JSDoc:514
export async function insertOwnFeedback(
	args: Pick<
		TablesInsertable["VoiceFeedback"],
		"voiceSessionId" | "rating" | "comment"
	>,
)
function

updateSettings

no JSDoc:527
export async function updateSettings({ isDisabled }: { isDisabled: boolean })
function

deleteOlderThan

no JSDoc:538
export async function deleteOlderThan({
	sessionsBefore,
	errorsBefore,
}: {
	sessionsBefore: number;
	errorsBefore: number;
})