Skip to content

bug: verification badge never expires — the documented 12/6-month window is never checked #251

Description

@yakew7

Problem

data/CONTRIBUTING.md explicitly documents an expiry window for the verified block:

A verification stays valid for 12 months — or 6 months for exam centres (sat_centre / foreign_lang_exam_centre)... After the window, the place should be verified again or the block removed.

data/competitions/CONTRIBUTING.md documents the same idea for competitions (6 months).

But nothing in the codebase actually enforces or checks this window:

  • src/components/pins/verified-badge.tsx:

    export function VerifiedBadge({ place }: { place: Place }) {
      if (!place.verified) return null;
      return ( /* renders the badge unconditionally */ );
    }

    There is no comparison of place.verified.on against "now" — a verification from years ago renders the exact same green "Verified" badge as one from yesterday, forever.

  • scripts/check-data-freshness.mjs (the script that already flags expired valid_till dates and lapsed competition cycles) never reads the verified block at all:

    $ grep -n "12.*month\|6.*month\|expir\|stale" src/lib src/components scripts -r --include="*.ts" --include="*.tsx" --include="*.mjs"
    # (no hits outside comments/docs — nothing checks verified.on against an expiry window)
    

So the documented behavior ("badge disappears after 12/6 months") doesn't exist — it's aspirational text with no code backing it.

Fix

Pick one (or both):

  1. VerifiedBadge (and the equivalent competition card badge) should stop rendering once verified.on is older than the documented window (6 months for sat_centre/foreign_lang_exam_centre and competitions, 12 months for everything else).
  2. scripts/check-data-freshness.mjs should flag (warn or error) any record whose verified.on has passed its window, the same way it already flags an expired valid_till.

Acceptance criteria

  • The 12/6-month window from data/CONTRIBUTING.md / data/competitions/CONTRIBUTING.md is actually enforced somewhere in code
  • A unit test covers a verified block that's past its window

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdataPlaces dataset

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions