Skip to content

feat: surface live Godot bridge state in runtime host#3

Merged
bdtran2002 merged 1 commit intomainfrom
feature/godot-bridge-followups
Apr 22, 2026
Merged

feat: surface live Godot bridge state in runtime host#3
bdtran2002 merged 1 commit intomainfrom
feature/godot-bridge-followups

Conversation

@bdtran2002
Copy link
Copy Markdown
Owner

@bdtran2002 bdtran2002 commented Apr 22, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Godot bridge state tracking with real-time synchronization from embedded iframe content.
    • Display of Godot bridge status information including entry state, multiplayer status, and last update timestamp.
    • Automatic checkpoint restoration of Godot bridge snapshots for session continuity.
  • Tests

    • Updated checkpoint restoration tests to verify Godot bridge snapshot data persistence.

@bdtran2002 bdtran2002 merged commit eadd37c into main Apr 22, 2026
2 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2877c80f-5870-4c80-9d80-a364f0d1dc03

📥 Commits

Reviewing files that changed from the base of the PR and between fd4a323 and 2decaf5.

📒 Files selected for processing (5)
  • extension/src/features/runtime-frame/upstream-checkpoint.ts
  • extension/src/features/runtime-frame/upstream-runtime-copy.ts
  • extension/src/features/runtime-frame/upstream-runtime-state.ts
  • extension/src/features/runtime-frame/upstream-runtime.ts
  • extension/tests/upstream-runtime.test.ts

📝 Walkthrough

Walkthrough

The changes add Godot bridge snapshot tracking to the upstream runtime system. A new state interface stores bridge metadata (entryState, multiplayerState, lastUpdate, updatedAt). UI display added for summary. Polling mechanism syncs snapshot from iframe window every 500ms. Checkpoint restoration and lifecycle management updated to preserve and initialize bridge state.

Changes

Cohort / File(s) Summary
State & Type Definitions
extension/src/features/runtime-frame/upstream-runtime-state.ts
Added UpstreamGodotBridgeSnapshot interface with four nullable string fields; extended UpstreamRuntimeState with new godotBridgeSnapshot property; initialized in createInitialUpstreamRuntimeState().
Checkpoint Restoration
extension/src/features/runtime-frame/upstream-checkpoint.ts
Added isNullableString() type guard; extended isUpstreamRuntimeState validation for godotBridgeSnapshot fields; modified restoreUpstreamRuntimeCheckpoint() to merge and restore snapshot with fallback to initial state.
UI Display & Formatting
extension/src/features/runtime-frame/upstream-runtime-copy.ts
Added godotBridge label; implemented godotBridgeSummary() formatter that concatenates non-null snapshot fields with fallback message when both entryState and multiplayerState are absent.
Runtime Integration & Polling
extension/src/features/runtime-frame/upstream-runtime.ts
Added UI field for Godot bridge summary display; implemented iframe polling loop (500ms interval) to sync __FORKORFRY_GODOT_BRIDGE__ and __FORKORFRY_GODOT_LAST_UPDATE__ globals; integrated polling start/stop into host lifecycle (pause, resume, shutdown); integrated checkpoint restoration and export manifest handling.
Test Fixtures
extension/tests/upstream-runtime.test.ts
Updated restored upstream runtime checkpoint state fixture to include godotBridgeSnapshot with specific values for all four fields.

Sequence Diagram

sequenceDiagram
    participant Host as Runtime Host
    participant Iframe as IFrame Window
    participant Poll as Polling Loop
    participant State as State Manager
    
    Host->>Iframe: Load iframe src
    Iframe-->>Host: iframe load event
    Host->>Poll: startGodotBridgePoll()
    activate Poll
    loop Every 500ms
        Poll->>Iframe: Read __FORKORFRY_GODOT_BRIDGE__
        Poll->>Iframe: Read __FORKORFRY_GODOT_LAST_UPDATE__
        Iframe-->>Poll: Return snapshot values
        Poll->>Poll: Check if changed vs current state
        alt Values changed
            Poll->>State: Update godotBridgeSnapshot
            State-->>Poll: State updated
        end
    end
    Host->>Poll: clearGodotBridgePoll() (on pause/shutdown)
    deactivate Poll
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A polling loop hops through the iframe glen,
Catching Godot bridge snapshots again and again!
State syncs smoothly, lifecycle hooks align,
Five hundred milliseconds of runtime design.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/godot-bridge-followups

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant