Files
aris/apps/aelis-backend/src/session/feed-source-provider.ts
kenneth ce5dc7fbd3 feat(backend): make FeedSourceProvider async
Make feedSourceForUser and FeedSourceProviderFn return promises.
Use Promise.allSettled to tolerate partial provider failures.
Guard concurrent getOrCreate calls with in-flight promise dedup.
Return 503 from HTTP handlers when session creation fails.

Co-authored-by: Ona <no-reply@ona.com>
2026-03-15 19:11:03 +00:00

10 lines
300 B
TypeScript

import type { FeedSource } from "@aelis/core"
export interface FeedSourceProvider {
feedSourceForUser(userId: string): Promise<FeedSource>
}
export type FeedSourceProviderFn = (userId: string) => Promise<FeedSource>
export type FeedSourceProviderInput = FeedSourceProvider | FeedSourceProviderFn