mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
`/events` showed skeletons until a client-side request to the Luma events API finished, so the raw HTML had no upcoming events and every category count read zero. I moved the Luma fetch to the server next to the Notion and MDX loaders, so the HTML now includes the event list, and I set the page to revalidate every 5 minutes. **Changed:** - **Event list in the HTML**: I built `getLumaEvents` on the upstream fetch from `/api-v2/luma-events`, which I made shareable and gave a 10 s timeout, with the same public-only filter and mapping the client used. I removed the client fetch, the loading state and both skeletons. - **Luma failures**: on a missing API key, an upstream error or a timeout, `getLumaEvents` returns no Luma events and reports the error to Sentry, the same soft fallback the Notion loader uses, so neither the build nor a regeneration can fail on Luma. - **Dates without hydration mismatches**: I format each event's date and time in the event's own time zone on the server and the first client render (banner times carry the zone name, and the banner always shows the year). After hydration the page switches to the visitor's time zone, as before. **Note:** before JavaScript loads, visitors now see event-local times labeled with their zone where they used to see skeletons. If Luma is down during a regeneration, the page shows no Luma events until the next successful regeneration. ## To test Tested on the PR preview: - [x] Fetch `<preview-url>/api-v2/luma-events?after=<now>`, then fetch `<preview-url>/events` with a Chrome user agent, strip `<script>`, `<style>` and `<template>` elements and React's `<!-- -->` separators: expect every returned event name in the HTML, `All (N)` equal to the number of event cards (`h3.leading-snug`), and no `animate-pulse` skeletons (5/5 names, `All (5)` with 5 cards, 0 skeletons; a 6 PM Denver event groups under its own local date) - [x] Open `/events` in a browser outside UTC: expect no hydration errors in the console, banner times in local time without a zone label, and no request to `/api-v2/luma-events` (Asia/Singapore: none of either) - [x] Click a category filter, then All; search for a title word, then clear it; toggle On-demand: expect the list to narrow and restore as before, and the banner to hide on On-demand ## Linear - part of GROWTH-1416