AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: HTTP requests fail - missing `tauri-plugin-http` in Tauri v2

未關閉
#1,087 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
283
分支
679
平均合併
7 天 2 小時
30 天內合併 PR
3

描述

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

**Description:**
The app cannot make HTTP requests to the localhost backend because `tauri-plugin-http` is not configured. This affects all users trying to run the full stack.

**Location:**
- `src-tauri/src/main.rs` - Missing HTTP plugin initialization
- `src/utils/serverUtils.ts:XX` - Uses `fetch()` which is blocked in Tauri v2

**Current Code:**
```rust
// main.rs - No HTTP plugin configured
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_dialog::init())
// Missing: .plugin(tauri_plugin_http::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```

**Impact:**
- `fetch(BACKEND_URL + '/health')` fails silently
- Frontend cannot connect to Python backend on port 52123
- App appears to work but backend communication is broken

**Fix Required:**

1. **Add to `Cargo.toml`:**
```toml
[dependencies]
tauri-plugin-http = "2.0.0"
```

2. **Update `main.rs`:**
```rust
.plugin(tauri_plugin_http::init())
```

3. **Add to `capabilities/migrated.json`:**
```json
{
"permissions": [
"http:default",
"http:allow-fetch"
]
}
```

**Related:**
This is a Tauri v2 security requirement - HTTP requests are blocked by default without the plugin.

### Record

- [x] I agree to follow this project's Code of Conduct

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。