Skip to content

Add OnConnectionChangeFunc to WASM UIImpl to fix compilation#331

Merged
myleshorton merged 3 commits intoadam/unbounded-widget-proxyfrom
copilot/sub-pr-330
Feb 23, 2026
Merged

Add OnConnectionChangeFunc to WASM UIImpl to fix compilation#331
myleshorton merged 3 commits intoadam/unbounded-widget-proxyfrom
copilot/sub-pr-330

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

The OnConnectionChangeFunc callback field was added to the non-WASM UIImpl struct but missing from the WASM version, causing compilation failures for WASM builds since both share the same BroflakeOptions struct.

Changes

  • Add OnConnectionChangeFunc field to WASM UIImpl struct in ui_wasm_impl.go
  • Update OnConsumerConnectionChange method to invoke callback before firing JavaScript event

Both implementations now have consistent callback support:

func (ui UIImpl) OnConsumerConnectionChange(state int, workerIdx int, addr net.IP) {
    if ui.OnConnectionChangeFunc != nil {
        ui.OnConnectionChangeFunc(state, workerIdx, addr)
    }
    // ... WASM-specific event firing continues
}

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits February 23, 2026 19:46
Co-authored-by: myleshorton <1143966+myleshorton@users.noreply.github.com>
Co-authored-by: myleshorton <1143966+myleshorton@users.noreply.github.com>
@myleshorton myleshorton marked this pull request as ready for review February 23, 2026 19:49
Copilot AI changed the title [WIP] Update implementation based on feedback for OnConnectionChangeFunc Add OnConnectionChangeFunc to WASM UIImpl to fix compilation Feb 23, 2026
@myleshorton myleshorton merged commit 29aa1c9 into adam/unbounded-widget-proxy Feb 23, 2026
@myleshorton myleshorton deleted the copilot/sub-pr-330 branch February 23, 2026 19:50
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