[v3] Fix Windows build error with go-webview2 v1.0.22#4645
Conversation
Fixes #4513 The go-webview2 library changed the MessageCallback signature in v1.0.22 from `func(string)` to `func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs)`. This caused a build error for users: ``` cannot use w.processMessage (value of type func(message string)) as func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs) value in assignment ``` Changes: - Updated processMessage signature to match go-webview2 v1.0.22 - Upgraded go-webview2 dependency from v1.0.21 to v1.0.22 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughUpdates dependency Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Edge as WebView2 (Edge)
participant WinWin as windowsWebviewWindow
participant Buffer as windowMessageBuffer
Edge->>WinWin: WebMessageReceived(message, sender, args)
note right of WinWin #cfe8ff: Callback now accepts sender and args
WinWin->>Buffer: Enqueue(message)
Buffer-->>WinWin: Ack
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Just tested this locally, looks like it works 👍 |
|
Fixes #4513 The go-webview2 library changed the MessageCallback signature in v1.0.22 from `func(string)` to `func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs)`. This caused a build error for users: ``` cannot use w.processMessage (value of type func(message string)) as func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs) value in assignment ``` Changes: - Updated processMessage signature to match go-webview2 v1.0.22 - Upgraded go-webview2 dependency from v1.0.21 to v1.0.22 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
v3/UNRELEASED_CHANGELOG.md (1)
26-27: Link issue/PR references for consistencyThe previous entry links directly to the PR; do the same here so readers can jump straight to the issue and PR details.
Apply this diff:
-- Fix Windows build error caused by go-webview2 v1.0.22 signature change (#4513, #4645) +- Fix Windows build error caused by go-webview2 v1.0.22 signature change ([#4513](https://github.com/wailsapp/wails/issues/4513), [#4645](https://github.com/wailsapp/wails/pull/4645))
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
v3/UNRELEASED_CHANGELOG.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
- GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
- GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
- GitHub Check: semgrep/ci
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
- GitHub Check: semgrep-cloud-platform/scan
|
* Fix Windows build error with go-webview2 v1.0.22 Fixes wailsapp#4513 The go-webview2 library changed the MessageCallback signature in v1.0.22 from `func(string)` to `func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs)`. This caused a build error for users: ``` cannot use w.processMessage (value of type func(message string)) as func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs) value in assignment ``` Changes: - Updated processMessage signature to match go-webview2 v1.0.22 - Upgraded go-webview2 dependency from v1.0.21 to v1.0.22 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix Windows build error with go-webview2 v1.0.22 Fixes wailsapp#4513 The go-webview2 library changed the MessageCallback signature in v1.0.22 from `func(string)` to `func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs)`. This caused a build error for users: ``` cannot use w.processMessage (value of type func(message string)) as func(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs) value in assignment ``` Changes: - Updated processMessage signature to match go-webview2 v1.0.22 - Upgraded go-webview2 dependency from v1.0.21 to v1.0.22 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>



Description
Fixes #4513
The go-webview2 library changed the
MessageCallbacksignature in v1.0.22 fromfunc(string)tofunc(message string, sender *ICoreWebView2, args *ICoreWebView2WebMessageReceivedEventArgs).This caused a build error for users on Windows:
Type of change
Changes Made
processMessagemethod signature inwebview_window_windows.goto match go-webview2 v1.0.22github.com/wailsapp/go-webview2dependency from v1.0.21 to v1.0.22How Has This Been Tested?
GOOS=windows GOARCH=amd64 go build)Checklist:
website/src/pages/changelog.mdxwith details of this PR🤖 Generated with Claude Code
Summary by CodeRabbit