signup: record the terms version that is actually in force #323

Stängd
öppnade 2026-10-08 21:12:37 +00:00 av supernaut · 0 kommentarer
Ägare

What

TERMS_VERSION in src/pages/api/signup.ts is hand-kept in sync with the "Last updated" / "Senast uppdaterad" line of the terms and privacy pages. Each sign-up stores that constant in signups.terms_version. No check fails when the two drift.

Why

The column proves which text a user accepted. It was stale once already (since fixed: it is 2026-10-11 now). The "keep in sync" comment still has no check behind it.

Failing case

Edit the date on terms.md, forget the constant. New sign-ups store a version that was already replaced.

Fix

  • Add a vitest. It reads the "Last updated" / "Senast uppdaterad" line from src/content/{sv,en}/terms.md and privacy.md.
  • Assert sv and en agree.
  • Assert the later of the terms and privacy dates equals TERMS_VERSION.

Done when

  • The test fails if a content date changes without the constant.
  • The PR lists any sign-up rows that stored an older version than the one shown, so the operator can decide whether to annotate them.
## What `TERMS_VERSION` in `src/pages/api/signup.ts` is hand-kept in sync with the "Last updated" / "Senast uppdaterad" line of the terms and privacy pages. Each sign-up stores that constant in `signups.terms_version`. No check fails when the two drift. ## Why The column proves which text a user accepted. It was stale once already (since fixed: it is `2026-10-11` now). The "keep in sync" comment still has no check behind it. ## Failing case Edit the date on `terms.md`, forget the constant. New sign-ups store a version that was already replaced. ## Fix - Add a vitest. It reads the "Last updated" / "Senast uppdaterad" line from `src/content/{sv,en}/terms.md` and `privacy.md`. - Assert sv and en agree. - Assert the later of the terms and privacy dates equals `TERMS_VERSION`. ## Done when - [ ] The test fails if a content date changes without the constant. - [ ] The PR lists any sign-up rows that stored an older version than the one shown, so the operator can decide whether to annotate them.
supernaut lade till detta till projektet Bitborg Web 2026-10-08 21:14:45 +00:00
Logga in för att delta i denna konversation.
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web#323
Ingen beskrivning angiven.