Skip to content

Conversation

@tariknz
Copy link
Owner

@tariknz tariknz commented Sep 14, 2025

Only publishes requested telemetry

When an overlay subscribes to a telemetry key on the telemetry store, IPC message is sent to the backend and the SDK will now append taht key to publish to that overlay.

After this change only the telemetry values that are needed are published to the windows for each overlay.

graph TD
    A[iRacing SDK] -->|Raw Telemetry Data| B[IRacingSDK Bridge]
    B -->|Full Telemetry Object| C[OverlayManager]
    
    D[Frontend Overlay] -->|useTelemetryFieldTracker hook| E[TelemetryStore]
    E -->|subscribeToTelemetryFields| F[IPC: subscribe-telemetry-fields]
    F -->|IPC Message| G[TelemetryBridge]
    G -->|Overlay ID + Fields| H[OverlayManager]
    
    H -->|Track Subscriptions| I[fieldSubscriptions Map]
    H -->|Track Field Mappings| J[fieldToOverlays Map]
    
    C -->|publishTelemetryFields| K{For each telemetry field}
    K -->|Check fieldToOverlays| L[Get subscribed overlays]
    L -->|Create OverlayTelemetryPayload| M[Send only subscribed fields]
    M -->|Targeted IPC| N[Specific Overlay Window]
    
    N -->|telemetry event| O[Frontend TelemetryProvider]
    O -->|Update TelemetryStore| P[Component re-renders]
    
    Q[Overlay Cleanup] -->|unsubscribeFromTelemetryFields| H
    H -->|Remove from maps| R[Clean up subscriptions]
    
    style A fill:#e1f5fe
    style D fill:#f3e5f5
    style H fill:#fff3e0
    style M fill:#e8f5e8
Loading

@tariknz tariknz marked this pull request as ready for review September 20, 2025 02:58
@tariknz tariknz merged commit 8292dab into main Sep 20, 2025
1 check passed
@tariknz tariknz deleted the feat/refactor-sdk-bridge branch September 20, 2025 03:07
tariknz added a commit that referenced this pull request Oct 4, 2025
tariknz added a commit that referenced this pull request Oct 4, 2025
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