-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[bug] Resource response randomly lose some characters in Android dev #6415
Comments
did you use create-tauri-app to bootstrap the project? seems like your vite.conf.json doesn't have necessary setup for mobile |
@amrbashir I didn't follow the document. Now the WebSocket works but the characters missing still happen. |
It seems like a bug of |
It seems because I made a simple demo: use std::net::{TcpStream, SocketAddr};
use std::io::{Write,self};
let mut stream = TcpStream::connect(SocketAddr::from(([192, 168, 74, 1], 1420))).unwrap();
write!(&stream, "GET /node_modules/.vite/deps/react-dom_client.js?v=b8bea35d HTTP/1.1\r\n").unwrap();
write!(&stream, "Host: 192.168.74.1:1420\r\n").unwrap();
write!(&stream, "Connection: close\r\n").unwrap();
write!(&stream, "\r\n").unwrap();
// SAVE HTTP response (including
let mut body = Vec::new();
io::copy(&mut stream, &mut body).unwrap(); The result may be like this: Some bytes will randomly lose. While if I modify // io::copy(&mut stream, &mut body).unwrap();
loop {
let mut chunk = [0u8; 8192];
match stream.read(&mut chunk) {
Ok(size) => {
if size == 0 {
break;
}
body.extend_from_slice(&chunk[0..size]);
}
Err(err) => {
// TODO
}
}
} |
Hey, attohttpc author here. Sorry you encountered so many issues. I think using reqwest is definitely the right call, reqwest/hyper is way more mature. Still, I'm going to try to investigate this bug with io::copy, it's really strange... |
Describe the bug
JS resource response randomly lose some characters.
Code of this line should be
hostParentIsContainer = prevHostParentIsContainer;
but I gothostParentIsContainer prevHostParentIsContainer;
And every time I reload the page, the location of losing character changed.
Reproduction
tauri-mobile-bug.zip (updated at Fri, 10 Mar 2023 12:00:37 GMT)
NOTE that the page may need reload once or more times. (E.g. using chrome://inspect/#devices to reload it)
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
Using Android simulator Pixel_XL_API_33 (x86_64)
It work well if redirect from
tauri.localhost
to the real host:The text was updated successfully, but these errors were encountered: