Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't cache the parsed markdows in the docs #11990

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/common/src/queryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export type QueryClient = vueQuery.QueryClient
const DEFAULT_QUERY_STALE_TIME_MS = Infinity
const DEFAULT_QUERY_PERSIST_TIME_MS = 30 * 24 * 60 * 60 * 1000 // 30 days

const DEFAULT_BUSTER = 'v1.1'
const DEFAULT_BUSTER = 'v1.2'

export interface QueryClientOptions<TStorageValue = string> {
readonly persisterStorage?: AsyncStorage<TStorageValue> & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export function MarkdownViewer(props: MarkdownViewerProps) {

const { data: markdownToHtml } = useSuspenseQuery({
queryKey: ['markdownToHtml', { text, imgUrlResolver, markedInstance }] as const,
meta: { persist: false },
gcTime: 0,
staleTime: 0,
queryFn: ({ queryKey: [, args] }) =>
args.markedInstance.parse(args.text, {
async: true,
Expand All @@ -38,15 +41,10 @@ export function MarkdownViewer(props: MarkdownViewerProps) {
const href = token.href

token.raw = href
token.href = await args
.imgUrlResolver(href)
.then((url) => {
return url
})
.catch((error) => {
logger.error(error)
return null
})
token.href = await args.imgUrlResolver(href).catch((error) => {
logger.error(error)
return null
})
token.text = getText('arbitraryFetchImageError')
}
},
Expand Down
Loading