fix: 应用 xhigh 代码评审的跨端修复
ci / server (push) Failing after 13s
ci / design-tokens (push) Failing after 11s

来自 xhigh code review 的正确性/健壮性修复,覆盖全部五端:
- server:鉴权 fail-closed、计量交叉校验与配额扣穿处理、WS 网关并发与关闭顺序、
  billing 行锁、redis Lua 过期与设备槽刷新、config 解析
- desktop:会话 epoch 防串话、WS 重连与 401 处理、api 客户端复用、统一 usePoll 轮询
- android:握手时序、请求头封装、账户状态派生、按需重组
- ios:finalize 宽限、串行采集、错误文案服务端优先、删除死代码 CommitController

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-13 11:50:08 +08:00
parent 50b49f3cbe
commit b5ab92a57e
42 changed files with 2125 additions and 469 deletions
+11 -1
View File
@@ -6,6 +6,15 @@ use std::sync::Arc;
use std::time::Duration;
use tauri::{AppHandle, Manager};
/// 协议平台标识(18H):mac / win / linux(区别于 std::env::consts::OS 的 macos/windows)。
const PLATFORM: &str = if cfg!(target_os = "macos") {
"mac"
} else if cfg!(target_os = "windows") {
"win"
} else {
"linux"
};
#[derive(Clone)]
pub struct Metrics {
queue: Arc<Mutex<Vec<Value>>>,
@@ -48,7 +57,8 @@ pub fn spawn(app: AppHandle) -> Metrics {
};
let body = json!({
"device_id": device_id,
"platform": std::env::consts::OS,
// 协议平台标识 mac/win/linux18H,区别于 std::env::consts::OS 的 macos/windows)。
"platform": PLATFORM,
"app_version": env!("CARGO_PKG_VERSION"),
"os_version": "",
"events": events,