Skip to content

Fix F1ServerApp Features/Models review findings - #591

Merged
LarsLaskowski merged 1 commit into
mainfrom
claude/fix-multiple-issues-d6y9b7
Aug 15, 2026
Merged

Fix F1ServerApp Features/Models review findings#591
LarsLaskowski merged 1 commit into
mainfrom
claude/fix-multiple-issues-d6y9b7

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Aug 15, 2026

Copy link
Copy Markdown
Owner

📖 Description

Fixes a batch of low-severity findings from the repository review affecting F1ServerApp Features and Models:

  • Replace any usage with concrete types for MAT_DIALOG_DATA payloads, chart.js click/hover handlers and MatSelect change events (cartelemetry, home, showsession, deletesession, createchampionship components).
  • Introduce shared TS enums and decoders (data/enums.ts) synchronized with F1Server.Core.Enumerations, replacing the duplicated and drifting numeric switch statements in sessionviewdata.ts, trackviewdata.ts, driverviewdata.ts and livesessionviewdata.ts.
  • Align ISessionViewData with SessionViewData (championshipId, hideImageButtons) and type loadTracks/loadTracksInternal as Promise<void> instead of Promise<any>.
  • Remove the unused LastSessionViewApiData/LastDriverApiData models and add the missing totalPacketsReceived field to SessionPacketMetricsViewApiData (the backend already computes and serializes it).
  • Replace magic numbers for session type comparisons in showsession.component.ts with the new SessionType enum.
  • Implement OnInit/OnDestroy where missing (statistics.component.ts, app.component.ts), remove an unused title field, and add error handling to a fire-and-forget HTTP call in app.component.ts.
  • Route diagnostic console.log/console.info calls through the existing LoggerService instead of logging directly in production (championships, createchampionship, sessions components).
  • SignalrService: use strict equality, plain methods instead of arrow-function fields, proper error logging, and expose live session state via observables in addition to the existing getters.

🎫 Issues

Closes #291, closes #276, closes #254, closes #252, closes #251, closes #250, closes #249, closes #270, closes #269, closes #267, closes #237, closes #235, closes #234

👩‍💻 Reviewer Notes

All changes are contained to F1ServerApp. No backend changes were needed. The chart.js event handler types were verified against the actual ng2-charts@10 type declarations to keep strictTemplates happy.

📑 Test Plan

ng build --configuration development passes with no TypeScript or template errors.

✅ Checklist

General

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.

Frontend-specific (Angular)

  • I have added a new Angular component or service in F1ServerApp.
  • I have modified an existing Angular component or service.
  • I have kept the frontend models/services in sync with the backend Data/ViewData contracts.

⏭ Next Steps

None.

Resolves a batch of low-severity findings from the repository review
affecting F1ServerApp components and viewdata models:

- Replace any usage with concrete types for MAT_DIALOG_DATA payloads,
  chart.js click/hover handlers and MatSelect change events.
- Introduce shared TS enums and decoders (data/enums.ts) synchronized
  with F1Server.Core.Enumerations, replacing the duplicated and
  drifting numeric switch statements in sessionviewdata.ts,
  trackviewdata.ts, driverviewdata.ts and livesessionviewdata.ts.
- Align ISessionViewData with SessionViewData (championshipId,
  hideImageButtons) and type loadTracks/loadTracksInternal as
  Promise<void> instead of Promise<any>.
- Remove the unused LastSessionViewApiData/LastDriverApiData models
  and add the missing totalPacketsReceived field to
  SessionPacketMetricsViewApiData.
- Replace magic numbers for session type comparisons with the new
  SessionType enum.
- Implement OnInit/OnDestroy where missing, remove an unused field,
  and add error handling to a fire-and-forget HTTP call.
- Route diagnostic console.log/console.info calls through the
  existing LoggerService instead of logging directly in production.
- SignalrService: use strict equality, plain methods instead of
  arrow-function fields, proper error logging, and expose live
  session state via observables in addition to the existing getters.

Closes #291, #276, #254, #252, #251, #250, #249, #270, #269, #267, #237, #235, #234
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski merged commit fdb6552 into main Aug 15, 2026
6 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/fix-multiple-issues-d6y9b7 branch August 15, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment