Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long string param will make "Overlapped I/O operation is in progress" panic of v1.0.13 #16

Open
mediawall opened this issue Sep 2, 2024 · 3 comments

Comments

@mediawall
Copy link

mediawall commented Sep 2, 2024


type Data struct {
	Msg string `json:"msg"`
}

// Greet returns a greeting for the given name
func (a *App) Greet(d Data) string {
	return "hello"
}

Error "Overlapped I/O operation is in progress" occurs if the length of the parameter is relatively long (approximately len(msg) >= 9000).

Steps to reproduce:

Download this project
myproject.zip

Run wails dev
Click the Greet button
Then you will see the error message on the console.

Error happens on Windows, the app works well on Linux.

@leaanthony
Copy link
Member

Fixed on master: #13

@lanyeeee
Copy link
Contributor

lanyeeee commented Sep 4, 2024

I found the panic occurs here:

_, _, err = sender.vtbl.PostWebMessageAsString.Call(
uintptr(unsafe.Pointer(sender)),
uintptr(unsafe.Pointer(_message)),
)
if err != nil && !errors.Is(err, windows.ERROR_SUCCESS) {
e.errorCallback(err)
}

This panic happens when the backend attempts to send the received message back to the frontend without any modification, and the message is long string.

It seems that when the data sent from the backend to the frontend via WebView is too large, the "Overlapped I/O operation is in progress" error occurs.

So, while it appears that the panic is caused by the frontend sending large data to the backend, it is actually similar to #12, where the issue is caused by the backend sending large data to the frontend(or more precisely, is caused by syscall).

Additionally, I don't quite understand why MessageReceived, after receiving the message and executing the callback function, needs to send the message back to the frontend via PostWebMessageAsString without any modification.
@leaanthony @mediawall maybe you should reopen this issue.

@mediawall
Copy link
Author

I can't reopen this issue, maybe only @leaanthony can do that.
I think your comment is correct.

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

No branches or pull requests

3 participants