slice 6 EdgarAdapter: fix full_text_search ETag caching (was not writing etags back); test asserts revalidation on 2nd call. 16/16 green (ornith-35)

This commit is contained in:
Investor Flow Build
2026-06-30 13:40:19 -04:00
parent cf1d7c7302
commit c2476ab137
2 changed files with 114 additions and 128 deletions
+7
View File
@@ -283,6 +283,13 @@ export class EdgarAdapter implements SourceFetch {
const searchData = resp?.body as { filings?: Array<Record<string, unknown>> } | undefined;
// Persist ETag + Last-Modified for future revalidation (matching filings_index/company_facts pattern).
const newStore: EdgarCacheStore = { cache: { ...s.cache }, etags: { ...s.etags }, lastModified: { ...s.lastModified } };
newStore.cache[key] = searchData?.filings ?? [];
if (resp?.headers?.etag) newStore.etags[key] = resp.headers.etag;
if (resp?.headers?.lastModified) newStore.lastModified[key] = resp.headers.lastModified;
writeStore(newStore);
return {
value: searchData?.filings ?? [],
ttlClass: 'daily_permanent',