fix(v3): revert goccy/go-json to stdlib encoding/json to fix Windows panic#4859
Conversation
Add FileFilter, OpenFileDialogOptions, SaveFileDialogOptions, and MessageDialogOptions to the init() warmup to prevent index out of bounds panic on Windows when these types are first unmarshaled. Fixes goccy/go-json#474 for Wails internal dialog types.
WalkthroughThis PR reverts from the external goccy/go-json dependency back to the standard library encoding/json across the codebase. It removes the dependency from go.mod, replaces all imports throughout the application, removes related initialization code, disables benchmarks, and addresses a reported index out of bounds panic on Windows. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (27)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧠 Learnings (12)📓 Common learnings📚 Learning: 2025-02-13T01:05:02.267ZApplied to files:
📚 Learning: 2026-01-04T08:01:00.038ZApplied to files:
📚 Learning: 2025-03-24T20:22:56.233ZApplied to files:
📚 Learning: 2025-02-24T06:08:55.645ZApplied to files:
📚 Learning: 2025-03-24T20:22:56.233ZApplied to files:
📚 Learning: 2025-03-24T06:54:22.127ZApplied to files:
📚 Learning: 2025-12-29T08:02:15.134ZApplied to files:
📚 Learning: 2025-01-18T21:19:47.778ZApplied to files:
📚 Learning: 2025-02-04T23:59:43.956ZApplied to files:
📚 Learning: 2025-01-15T22:30:08.796ZApplied to files:
📚 Learning: 2025-01-15T22:40:58.594ZApplied to files:
⏰ 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). (5)
🔇 Additional comments (29)
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 |
|
Deploying wails with
|
| Latest commit: |
8cce4b8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://533671e1.wails.pages.dev |
| Branch Preview URL: | https://v3-fix-go-json-dialog-types.wails.pages.dev |
4ab4471 to
74317dc
Compare
74317dc to
1dd2201
Compare
…panic goccy/go-json has a type address calculation bug on Windows that causes index out of bounds panic when decoding user-defined types for the first time. This reverts all runtime usages of goccy/go-json back to stdlib encoding/json. Test and benchmark files are left unchanged. Partially reverts PR #4843.
1dd2201 to
8cce4b8
Compare
|
…panic (wailsapp#4859) * fix(v3): warm up dialog types in go-json cache to prevent Windows panic Add FileFilter, OpenFileDialogOptions, SaveFileDialogOptions, and MessageDialogOptions to the init() warmup to prevent index out of bounds panic on Windows when these types are first unmarshaled. Fixes goccy/go-json#474 for Wails internal dialog types. * fix(v3): revert goccy/go-json to stdlib encoding/json to fix Windows panic goccy/go-json has a type address calculation bug on Windows that causes index out of bounds panic when decoding user-defined types for the first time. This reverts all runtime usages of goccy/go-json back to stdlib encoding/json. Test and benchmark files are left unchanged. Partially reverts PR wailsapp#4843.


Summary
Reverts all runtime usages of
goccy/go-jsonback to stdlibencoding/jsonto fix a Windows-specific panic.Problem
After upgrading to alpha.56, calling service methods on Windows causes an index out of bounds panic:
This is caused by a bug in
goccy/go-json's type address calculation on Windows. The library uses memory address-based type caching which produces garbage values on Windows for types not warmed up during init().Solution
Revert to stdlib
encoding/jsonfor all runtime code paths. The performance gains fromgoccy/go-jsonare not worth the stability issues on Windows.This partially reverts PR #4843.
Files Changed
v3/internal/assetserver/webview/(4 files)v3/internal/capabilities/v3/internal/runtime/v3/pkg/application/(13 files)v3/pkg/services/(4 files)Test and benchmark files are left unchanged.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.