Skip to content

"LIVE" badge on the carousel is hardcoded, not tied to actual data freshness #54

Description

@2ndtlmining

Labels: bug, ui

Problem

src/lib/components/CarouselCard.svelte renders a static label:

<span class="live-text">LIVE</span>

This always displays regardless of how old the underlying data is. The carousel is refreshed on the same up-to-1-hour cadence as Issue 1 (see CAROUSEL_INTERVAL_MS in servicesScheduler.js), so "LIVE" can be showing data that's nearly an hour old. The backend already computes real freshness info that the frontend ignores — getCachedCarouselData() in carouselService.js returns cached, cacheAge (seconds), and fresh, and the /api/carousel/stats route passes all three through, but CarouselCard.svelte never reads them for the badge.

Solution

Bind the badge to the freshness data already available in the API response:

{#if cacheAge < 300}
  <span class="live-text">LIVE</span>
{:else}
  <span class="stale-text">Updated {formatAge(cacheAge)} ago</span>
{/if}

Pick whatever threshold matches the true refresh interval once Issue 1 is resolved (e.g. under 5 minutes = "LIVE").

Files: src/lib/components/CarouselCard.svelte, src/lib/services/carouselService.js (data already available, just unused)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions