Always revalidate first page for local source browse requests

fixes #1041
This commit is contained in:
schroda
2025-12-14 01:01:55 +01:00
parent 43d994f843
commit 30856f996d
2 changed files with 6 additions and 4 deletions

View File

@@ -404,7 +404,7 @@ export function SourceMangas() {
return;
}
const requiresClear = SPECIAL_ED_SOURCES.REVALIDATION.includes(sourceId);
const requiresClear = SPECIAL_ED_SOURCES.REVALIDATION_UNSUPPORTED.includes(sourceId);
if (!requiresClear) {
return;
}

View File

@@ -350,6 +350,7 @@ import { useLocalStorage } from '@/base/hooks/useStorage.tsx';
import { KO_SYNC_LOGIN, KO_SYNC_LOGOUT } from '@/lib/graphql/mutations/KoreaderSyncMutation.ts';
import { GET_KO_SYNC_STATUS } from '@/lib/graphql/queries/KoreaderSyncQuery.ts';
import { ImageCache } from '@/lib/service-worker/ImageCache.ts';
import { Sources } from '@/features/source/services/Sources.ts';
enum GQLMethod {
QUERY = 'QUERY',
@@ -453,9 +454,10 @@ const CACHE_PAGES_KEY = 'GET_SOURCE_MANGAS_FETCH_PAGES';
const CACHE_RESULTS_KEY = 'GET_SOURCE_MANGAS_FETCH';
export const SPECIAL_ED_SOURCES = {
REVALIDATION: [
REVALIDATION_UNSUPPORTED: [
'57122881048805941', // e-hentai
],
REVALIDATION_SKIP_TTL: [Sources.LOCAL_SOURCE_ID],
};
// TODO - extract logic to reduce the size of this file... grew waaaaaaaaaaaaay too big peepoFat
@@ -594,7 +596,7 @@ export class RequestManager {
maxPage: number,
signal: AbortSignal,
): Promise<void> {
if (SPECIAL_ED_SOURCES.REVALIDATION.includes(sourceId)) {
if (SPECIAL_ED_SOURCES.REVALIDATION_UNSUPPORTED.includes(sourceId)) {
return;
}
@@ -603,7 +605,7 @@ export class RequestManager {
Date.now() - (this.cache.getFetchTimestampFor(cacheResultsKey, getVariablesFor(pageToRevalidate)) ?? 0) >=
d(5).minutes.inWholeMilliseconds;
if (isFirstPage && !isTtlReached) {
if (isFirstPage && !isTtlReached && !SPECIAL_ED_SOURCES.REVALIDATION_SKIP_TTL.includes(sourceId)) {
return;
}