fix: invalidate library series cache when read progress changes
Some checks failed
Deploy with Docker Compose / deploy (push) Failing after 48s

- Add LIBRARY_SERIES_CACHE_TAG to getLibrarySeries fetch
- Revalidate library-series tag in updateReadProgress and deleteReadProgress
- Add eslint ignores for temp/, .next/, node_modules/

Made-with: Cursor
This commit is contained in:
2026-03-02 13:27:59 +01:00
parent 4288e4c541
commit 30e3529be3
3 changed files with 16 additions and 5 deletions

View File

@@ -31,6 +31,8 @@ const sortSeriesDeterministically = <T extends { id: string; metadata?: { titleS
});
};
export const LIBRARY_SERIES_CACHE_TAG = "library-series";
export class LibraryService extends BaseApiService {
private static readonly CACHE_TTL = 300; // 5 minutes
@@ -134,7 +136,12 @@ export class LibraryService extends BaseApiService {
const response = await this.fetchFromApi<LibraryResponse<Series>>(
{ path: "series/list", params },
headers,
{ method: "POST", body: JSON.stringify(searchBody), revalidate: this.CACHE_TTL }
{
method: "POST",
body: JSON.stringify(searchBody),
revalidate: this.CACHE_TTL,
tags: [LIBRARY_SERIES_CACHE_TAG],
}
);
const filteredContent = response.content.filter((series) => !series.deleted);