feat(session): query enabled sources before providers (#85)

UserSessionManager now queries the user_sources table for enabled
sources before calling any provider. Providers receive the per-user
JSON config directly instead of querying the DB themselves, removing
their db dependency and eliminating redundant round-trips.

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-03-22 16:28:19 +00:00
committed by GitHub
parent b24d879d31
commit a6be7b31e7
13 changed files with 368 additions and 200 deletions

View File

@@ -51,7 +51,6 @@ async function handleUpdateProviderConfig(c: Context<Env>) {
}
const sessionManager = c.get("sessionManager")
const db = c.get("db")
let body: unknown
try {
@@ -68,7 +67,6 @@ async function handleUpdateProviderConfig(c: Context<Env>) {
}
const updated = new WeatherSourceProvider({
db,
credentials: parsed.credentials,
})