记录前端旁路 IPC 与状态写入失败
最近项目、全屏和 ACL 清理失败写入 WebView 诊断 补充旁路错误排障记录
This commit is contained in:
@@ -1258,8 +1258,13 @@ export function App({
|
||||
setManifest(openedProject.manifest);
|
||||
setMessages(conversationMessages);
|
||||
setConversationVisibleCount(CONVERSATION_INITIAL_VISIBLE_COUNT);
|
||||
void rememberRecentWorkspace(openedProject.projectPath).catch(() => {
|
||||
// 最近项目是辅助投影;Rust 建项/打开结果不因偏好写入失败而回滚。
|
||||
void rememberRecentWorkspace(openedProject.projectPath).catch((error) => {
|
||||
// 最近项目是辅助投影;Rust 建项/打开结果不因偏好写入失败而回滚,
|
||||
// 但失败正文仍须进入诊断,不能静默丢掉本地 I/O 事实。
|
||||
appendWebviewLog('error', [
|
||||
'[AGC] 最近项目偏好写入失败',
|
||||
visibleClientErrorMessage(error),
|
||||
]);
|
||||
});
|
||||
setWorkspaceStatus(`已打开:${openedProject.projectPath}`);
|
||||
appendLocalPermissionLog(
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { resolveTauriInvoke } from '../../app/tauri';
|
||||
import {
|
||||
appendWebviewLog,
|
||||
visibleClientErrorMessage,
|
||||
} from '../../services/errorReporting';
|
||||
|
||||
/**
|
||||
* 用户主动操作(打开/新建项目、选择目录、重命名刷新)时调用:解除 Rust 侧的 ACL 提权拒绝记忆。
|
||||
@@ -16,7 +20,12 @@ export function clearAclElevationDenials() {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
void invoke('clear_game_creator_acl_elevation_denials').catch(() => {});
|
||||
void invoke('clear_game_creator_acl_elevation_denials').catch((error) => {
|
||||
appendWebviewLog('error', [
|
||||
'[AGC] 清理 ACL 提权拒绝记忆失败',
|
||||
visibleClientErrorMessage(error),
|
||||
]);
|
||||
});
|
||||
} catch {
|
||||
// 命令缺失等同步异常同样不影响本次操作:这只是一次旁路清零。
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@ import {
|
||||
useState,
|
||||
} from 'react';
|
||||
|
||||
import {
|
||||
appendWebviewLog,
|
||||
visibleClientErrorMessage,
|
||||
} from '../../services/errorReporting';
|
||||
|
||||
export type ElementFullscreenController<T extends HTMLElement> = {
|
||||
/** 要全屏的那一格;挂在它的 `ref` 上。 */
|
||||
ref: RefObject<T | null>;
|
||||
@@ -63,12 +68,22 @@ export function useElementFullscreen<
|
||||
// 已经有人在全屏(本元素,或页面里别的东西)时这一步只负责退出:退出本身幂等,
|
||||
// 不需要先判断当前全屏的是不是自己。
|
||||
if (ownerDocument.fullscreenElement) {
|
||||
void ownerDocument.exitFullscreen?.()?.catch(() => {});
|
||||
void ownerDocument.exitFullscreen?.()?.catch((error) => {
|
||||
appendWebviewLog('error', [
|
||||
'[AGC] 退出预览全屏失败',
|
||||
visibleClientErrorMessage(error),
|
||||
]);
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 失败(用户手势丢失、权限策略拒绝)不改按钮状态,界面回到「还是没全屏」的原样;
|
||||
// 拒绝的 Promise 必须接住,否则会冒成未处理拒绝。
|
||||
void element.requestFullscreen?.()?.catch(() => {});
|
||||
void element.requestFullscreen?.()?.catch((error) => {
|
||||
appendWebviewLog('error', [
|
||||
'[AGC] 进入预览全屏失败',
|
||||
visibleClientErrorMessage(error),
|
||||
]);
|
||||
});
|
||||
}, []);
|
||||
|
||||
return { ref: elementRef, isFullscreen, isSupported, toggleFullscreen };
|
||||
|
||||
@@ -38,6 +38,8 @@ Direct 的 Tauri 进度、活动回合和 manifest 事件不能忽略 `app.emit`
|
||||
|
||||
更新安装完成后的 `restart_agc_app` 失败也必须写入诊断;安装已启动但重启 IPC 失败时,不能让用户只看到“下载完成”后客户端继续停留在旧进程。
|
||||
|
||||
最近项目偏好写入、全屏 API、ACL 拒绝记忆清理等旁路操作也要记录失败正文;它们不阻断主操作,但静默吞错会让本地状态、权限冷却或预览状态无法解释。
|
||||
|
||||
`WindowChrome.test.tsx` 当前没有在用例间清理挂载的 `WindowChrome`,多用例运行会出现重复标题和重复窗口按钮;这属于测试隔离问题,不能把它误判成窗口 IPC 行为回归。
|
||||
|
||||
## 2026-10-03 AGC 随包 plugins 的 feature 档位必须与消费方一致,且门禁会因 build.rs 未重跑而假通过
|
||||
|
||||
Reference in New Issue
Block a user