fix: concurrent cache miss, SVG output, narrowed error handling, format

- Fix integration data cache: check pending promise before TTL to
  prevent returning undefined on concurrent cold-cache access
- Add concurrent-miss test (two parallel callers, one fetch)
- SVG sanitizer: extract <svg> from DOMPurify output to strip
  residual HTML wrapper
- Narrow safeRevalidateTag catch: log unexpected errors, silence only
  known "outside request scope" messages
- Run oxfmt across all packages (206 files formatted)
This commit is contained in:
Thomas Camlong committed 2026-08-07 20:48:17 +02:00
1 parent b81b90875f
commit 38ac8f3075
206 files changed
+7952 -6722

No files matched your search

@@ -33,11 +33,7 @@ export async function SessionScopedProviders({ children }: PropsWithChildren) {
})
: null,
);
const [session, user, serverSettings] = await Promise.all([
sessionPromise,
userPromise,
getRscServerSettingsAsync(),
]);
const [session, user, serverSettings] = await Promise.all([sessionPromise, userPromise, getRscServerSettingsAsync()]);
const StackedProvider = composeWrappers([
(innerProps) => <AuthProvider session={session} logoutUrl={env.AUTH_LOGOUT_REDIRECT_URL} {...innerProps} />,
@@ -31,7 +31,11 @@ interface CreateBoardLayoutProps<TParams extends Params> {
const BoardLayoutFallback = ({ headerActions }: { headerActions: JSX.Element }) => (
<ClientShell hasNavigation={false}>
<MainHeader logo={<BoardLogoWithTitle size="md" hideTitleOnMobile />} actions={headerActions} hasNavigation={false} />
<MainHeader
logo={<BoardLogoWithTitle size="md" hideTitleOnMobile />}
actions={headerActions}
hasNavigation={false}
/>
<AppShellMain>
<Skeleton height="100%" radius="sm" />
</AppShellMain>
@@ -85,7 +85,9 @@ const purify = createDOMPurify(window as unknown as Parameters<typeof createDOMP
export const sanitizeSvg = (svgText: string) => {
// linkedom's DOMParser omits html/body for fragment-only SVG; DOMPurify needs a body root.
const wrapped = `<html><body>${svgText}</body></html>`;
return purify.sanitize(wrapped, svgSanitizeOptions);
const sanitized = purify.sanitize(wrapped, svgSanitizeOptions);
const svgMatch = sanitized.match(/<svg[\s\S]*<\/svg>/i);
return svgMatch ? svgMatch[0] : sanitized;
};
export { svgSanitizeOptions, purify };
@@ -13,10 +13,8 @@
transform 150ms ease;
}
:global(.grid-stack-item[data-type="item"]:not([data-kind="app"]):hover)
.wrapper,
:global(.grid-stack-item[data-type="item"]:not([data-kind="app"]):focus-within)
.wrapper {
:global(.grid-stack-item[data-type="item"]:not([data-kind="app"]):hover) .wrapper,
:global(.grid-stack-item[data-type="item"]:not([data-kind="app"]):focus-within) .wrapper {
opacity: 1;
transform: translateY(0);
}