Skip to content

fix(p0): repair build, achievements, conductor, and CI gates - #4

Merged
KniggeMS merged 1 commit into
mainfrom
fix/p0-build-achievements-ci
May 9, 2026
Merged

fix(p0): repair build, achievements, conductor, and CI gates#4
KniggeMS merged 1 commit into
mainfrom
fix/p0-build-achievements-ci

Conversation

@KniggeMS

@KniggeMS KniggeMS commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

P0-Fixes: Build, Achievements-Logik, Provider-/Conductor-Tests und CI-Gates.

  • Build: MovieDetailModal.tsx TypeScript-Fehler behoben — unbekannte conductor-Prop auf ListMenu entfernt und posterPath (nullable) auf '' gemappt für img src.
  • Achievements: Explizites threshold-Feld auf Achievement eingeführt und Vergleich gegen items.length statt fragilem parseInt(id.split('-')[1]) (das für first-blood NaN ergab und alle Achievements unlocked-bleiben ließ).
  • MovieConductor:
    • Re-Entrancy-Guard für LOAD_MOVIES: parallele Dispatches teilen jetzt eine in-flight Promise → kein "Loop of Death" mehr.
    • ADD_MOVIE ruft adapter.exists() auf und verhindert Duplikate; bei Erfolg werden Statistics + Achievements neu berechnet.
    • SELECT_MOVIE nutzt zuerst getMovieDetails (was der Providers-Test prüft) und fällt sonst auf getById / lokalen Cache zurück.
  • CI: npm run lint || true durch echte Gates ersetzt: npx tsc --noEmit und npx vitest run, plus ein Test-Stub VITE_TMDB_API_KEY=test-key, damit die SupabaseMovieService-Fetch-Mock-Tests den API-Key-Guard passieren können.

Test plan

  • npx tsc --noEmit → keine Fehler
  • VITE_TMDB_API_KEY=test-key npx vitest run → 17/17 grün (vorher 8 rot)
  • VITE_TMDB_API_KEY=test-key npm run build → erfolgreich (Vite + PWA)

🤖 Generated with Claude Code

- MovieDetailModal: drop unsupported `conductor` prop on ListMenu and
  coerce nullable posterPath to '' for img src to satisfy TS.
- Achievements: add explicit `threshold` field on Achievement and check
  against `items.length` instead of parsing the id string (which
  produced NaN for non-numeric ids like `first-blood`).
- MovieConductor:
  * guard re-entrant LOAD_MOVIES so rapid dispatches share one in-flight
    promise (fixes Loop-of-Death test, adapter called once).
  * ADD_MOVIE now consults adapter.exists() and rejects duplicates with
    a clear error; updates statistics + achievements on success.
  * SELECT_MOVIE now goes through getMovieDetails first (with fallback
    to getById / cached items), which is what the providers test asserts.
- CI: replace soft `lint || true` with real gates: `tsc --noEmit` and
  `vitest run`, plus a stub VITE_TMDB_API_KEY so the SupabaseMovieService
  fetch-mock tests can reach the mocked fetch path.
@KniggeMS
KniggeMS merged commit 22f3921 into main May 9, 2026
1 check passed

@KniggeMS KniggeMS left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants