You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(links): defer OG fetch via after(), share Zod schemas, rename MAX_HOPS
Address review feedback on umami-software#4264:
- Split applyOgFields into sync applyOgIntent + async backfillOgMetadata.
Routes now wrap the create/update with next/server after() so the
5s-bounded OG fetch no longer blocks the response. backfillOgMetadata
uses per-field updateMany guarded on url + *Manual:false + deletedAt:null
so a slow backfill can't clobber a newer URL, manual override, or
soft-deleted row. applyOgIntent also nulls auto-managed OG fields up
front on url change so the prior URL's metadata isn't shown in the gap.
- Extract duplicated Zod helpers (utmField, ogTitleField, ogDescriptionField,
ogImageField, isHttpUrl, isPublicHttpUrl) to src/app/api/links/schemas.ts.
- Rename MAX_REDIRECTS to MAX_HOPS for accuracy (semantics unchanged).
API semantics note: POST /api/links and POST /api/links/:linkId now
return auto OG fields as null initially; values populate within ~3s.
UI live-preview already runs client-side via /api/links/og-preview.
0 commit comments