refactor: make fetchContext required on FeedSource

Sources that cannot provide context now return null
instead of omitting the method. The engine checks the
return value rather than method existence.

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-02-14 16:20:24 +00:00
parent 476c6f06d9
commit 1f2920a7ad
12 changed files with 154 additions and 50 deletions

View File

@@ -27,11 +27,11 @@ describe("LocationSource", () => {
expect(items).toEqual([])
})
test("fetchContext returns empty when no location", async () => {
test("fetchContext returns null when no location", async () => {
const source = new LocationSource()
const context = await source.fetchContext()
expect(context).toEqual({})
expect(context).toBeNull()
})
test("fetchContext returns location when available", async () => {