tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.59k stars 2.44k forks source link

[bug] macOS: getting random response with custom protocol when using sync XHR #5750

Open BillGoldenWater opened 1 year ago

BillGoldenWater commented 1 year ago

Describe the bug

when using sync XHR to send request to a custom protocol, will get random(every run) response. correct response when async XHR. sync XHR works no problem in safari

Reproduction

git clone https://github.com/BiliGoldenWater/TauriSyncXHRResponseIssueRepro cd TauriSyncXHRResponseIssueRepro npm install npm run tauri dev

Expected behavior

correct reponse

Platform and versions

Environment › OS: Mac OS 13.0.0 X64 › Node.js: 18.7.0 › npm: 8.15.0 › pnpm: Not installed! › yarn: 1.22.18 › rustup: 1.25.1 › rustc: 1.65.0 › cargo: 1.65.0 › Rust toolchain: stable-aarch64-apple-darwin

Packages › @tauri-apps/cli [NPM]: 1.2.1 › @tauri-apps/api [NPM]: 1.2.0 › tauri [RUST]: 1.2.1, › tauri-build [RUST]: 1.2.1, › tao [RUST]: 0.15.6, › wry [RUST]: 0.22.5,

App › build-type: bundle › CSP: unset › distDir: ../dist › devPath: ../dist

App directory structure ├─ dist ├─ node_modules ├─ src-tauri └─ .git

Stack trace

No response

Additional context

macOS 13.0, Apple Silicon

LikeNeko commented 1 year ago

Did you eventually solve this problem? I’m also facing the same issue.

BillGoldenWater commented 1 year ago

Did you eventually solve this problem? I’m also facing the same issue.

no, I end up with async everywhere