feat: 愚人节彩蛋 + 设置页修复 + GCK 安全加固 + CI/CodeRabbit#8
Conversation
- 4月1日当天性能面板所有延迟值显示为负数 - 解码延迟图标变为 ❄️,颜色变为青色 - 首次显示弹出 toast: 负延迟串流™ 已激活 - 非愚人节完全无影响
- 版本号点击复制到剪贴板并 toast 反馈 - 背景图片类型切换后提示重启应用生效
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthrough添加 CodeRabbit 配置;前端性能面板加入愚人节负延迟彩蛋并调整显示逻辑;设置页改为复制版本号并修改提示;原生手柄模块增强 dlsym 检查并用安全宏封装注册/注销与锁逻辑;新增 ScanKit/ShareKit 类型存根与清单;CI 脚本补入 SDK stub 与占位 DevKeySecret;GitHub 构建改为 HAR 并移除自动发布。 Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@entry/src/main/ets/components/PerformanceOverlay.ets`:
- Around line 196-214: The code currently mutates real metric fields
(this.perfLatency, this.perfNetworkLatency, this.perfHostLatency) inside
isAprilFools() which breaks downstream logic that checks raw values (e.g., !== 0
or < 0); instead preserve the original stats.* values and introduce a separate
aprilFoolsMode/display variables used only for rendering. Concretely: stop
writing back into this.perfLatency/this.perfNetworkLatency/this.perfHostLatency
inside isAprilFools(); add a boolean flag (e.g., this.aprilFoolsMode) set when
isAprilFools() is true and this.aprilFoolsToastShown logic remains the same;
compute negative display values only in the render layer or add dedicated
display fields (e.g., perfLatencyDisplay, perfNetworkLatencyDisplay,
perfHostLatencyDisplay) derived from stats.* and this.aprilFoolsMode so business
logic continues to see original numeric values while the UI shows the
negative-easter-egg values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1ed2fd94-42aa-40f3-8357-456d52b39ac5
📒 Files selected for processing (4)
.coderabbit.yamlentry/src/main/ets/components/PerformanceOverlay.etsentry/src/main/ets/components/PerformanceOverlayManager.etsentry/src/main/ets/pages/SettingsPageV2.ets
| // 🎃 愚人节彩蛋:负延迟串流™ | ||
| if (isAprilFools()) { | ||
| if (stats.latency > 0) { | ||
| this.perfLatency = -(stats.latency * (0.3 + Math.random() * 0.4)); | ||
| } | ||
| if (stats.networkLatency > 0) { | ||
| this.perfNetworkLatency = -Math.ceil(stats.networkLatency * (0.2 + Math.random() * 0.3)); | ||
| } | ||
| if (stats.hostLatency > 0) { | ||
| this.perfHostLatency = -(stats.hostLatency * (0.3 + Math.random() * 0.3)); | ||
| } | ||
| if (!this.aprilFoolsToastShown) { | ||
| this.aprilFoolsToastShown = true; | ||
| promptAction.showToast({ | ||
| message: '🔮 负延迟串流™ 已激活\n画面将在你操作之前到达', | ||
| duration: 5000 | ||
| }); | ||
| } | ||
| } |
There was a problem hiding this comment.
别把彩蛋状态塞进真实延迟值里。
Line 198、Line 201 和 Line 204 只有在值 > 0 时才改写;配合 Line 585、Line 621、Line 719 和 Line 745 的 !== 0 判断,4 月 1 日只要原始延迟还是 0,面板就会继续显示 N/A/0ms,达不到“所有延迟值都显示为负数”的效果。并且后续渲染统一用 < 0 当彩蛋开关,语义被绑在了业务值上。建议保留真实统计值,单独引入 aprilFoolsMode 或 display 字段,在渲染层生成负值展示。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@entry/src/main/ets/components/PerformanceOverlay.ets` around lines 196 - 214,
The code currently mutates real metric fields (this.perfLatency,
this.perfNetworkLatency, this.perfHostLatency) inside isAprilFools() which
breaks downstream logic that checks raw values (e.g., !== 0 or < 0); instead
preserve the original stats.* values and introduce a separate
aprilFoolsMode/display variables used only for rendering. Concretely: stop
writing back into this.perfLatency/this.perfNetworkLatency/this.perfHostLatency
inside isAprilFools(); add a boolean flag (e.g., this.aprilFoolsMode) set when
isAprilFools() is true and this.aprilFoolsToastShown logic remains the same;
compute negative display values only in the render layer or add dedicated
display fields (e.g., perfLatencyDisplay, perfNetworkLatencyDisplay,
perfHostLatencyDisplay) derived from stats.* and this.aprilFoolsMode so business
logic continues to see original numeric values while the UI shows the
negative-easter-egg values.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nativelib/src/main/cpp/game_controller_native.cpp (1)
778-835:⚠️ Potential issue | 🟠 MajorRegisterAllInputMonitors 直接调用的 50+ 函数指针缺少验证导致风险。
初始化时通过 dlsym 加载了大量
OH_GamePad_*函数指针(按键和轴监听注册/注销),但仅验证了pfn_OH_GameDevice_RegisterDeviceMonitor一个符号。其余 49+ 函数指针未做空指针检查,若设备上的libohgame_controller.z.so缺少其中任一符号,直接调用将触发崩溃。建议在
RegisterAllInputMonitors和UnregisterAllInputMonitors中补充成组的空指针检查,或在初始化阶段验证所有必需符号是否加载成功。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nativelib/src/main/cpp/game_controller_native.cpp` around lines 778 - 835, RegisterAllInputMonitors and UnregisterAllInputMonitors call many OH_GamePad_* function pointers without null checks (only pfn_OH_GameDevice_RegisterDeviceMonitor was validated); update these functions to guard each call (e.g., check the corresponding function pointer is non-null before invoking OH_GamePad_ButtonA_RegisterButtonInputMonitor / OH_GamePad_ButtonA_UnregisterButtonInputMonitor and all other OH_GamePad_*_Register*/Unregister* symbols), skip the call and log a clear error if a symbol is missing, and/or add a single initialization-time verifier that asserts all required OH_GamePad_* function pointers were loaded (in addition to pfn_OH_GameDevice_RegisterDeviceMonitor) so missing symbols are detected early.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@nativelib/src/main/cpp/game_controller_native.cpp`:
- Around line 778-835: RegisterAllInputMonitors and UnregisterAllInputMonitors
call many OH_GamePad_* function pointers without null checks (only
pfn_OH_GameDevice_RegisterDeviceMonitor was validated); update these functions
to guard each call (e.g., check the corresponding function pointer is non-null
before invoking OH_GamePad_ButtonA_RegisterButtonInputMonitor /
OH_GamePad_ButtonA_UnregisterButtonInputMonitor and all other
OH_GamePad_*_Register*/Unregister* symbols), skip the call and log a clear error
if a symbol is missing, and/or add a single initialization-time verifier that
asserts all required OH_GamePad_* function pointers were loaded (in addition to
pfn_OH_GameDevice_RegisterDeviceMonitor) so missing symbols are detected early.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 419e73e0-f02d-429b-aa7b-3dfcef3ee122
📒 Files selected for processing (1)
nativelib/src/main/cpp/game_controller_native.cpp
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ci/patch-sdk.sh`:
- Around line 132-136: The DEV_KEY_SECRET path is constructed relative to the
current working directory which breaks when the script is invoked from
elsewhere; update the script to compute repository root from the script location
(e.g., use a SCRIPT_DIR or REPO_ROOT derived from $(dirname "$0")/..), then set
DEV_KEY_SECRET to that absolute path (use the unique variable name
DEV_KEY_SECRET). Before copying, explicitly check that the template file
"${DEV_KEY_SECRET}.example" exists and fail with a clear error message if it
does not (instead of letting set -e cause an opaque crash); still create parent
directories with mkdir -p "$(dirname "$DEV_KEY_SECRET")" and only then cp the
example into DEV_KEY_SECRET.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4aea9f03-552f-41c5-ac5c-9bbe42f9e6a9
📒 Files selected for processing (7)
ci/patch-sdk.shci/sdk-stubs/kit.ScanKit.d.tsci/sdk-stubs/kit.ScanKit.jsonci/sdk-stubs/kit.ShareKit.d.tsci/sdk-stubs/kit.ShareKit.jsonentry/src/main/ets/components/CustomKeyOverlay.etsentry/src/main/ets/service/QrShareService.ets
✅ Files skipped from review due to trivial changes (4)
- ci/sdk-stubs/kit.ScanKit.json
- ci/sdk-stubs/kit.ShareKit.json
- ci/sdk-stubs/kit.ScanKit.d.ts
- ci/sdk-stubs/kit.ShareKit.d.ts
| DEV_KEY_SECRET="entry/src/main/ets/config/DevKeySecret.ets" | ||
| if [ ! -f "$DEV_KEY_SECRET" ]; then | ||
| mkdir -p "$(dirname "$DEV_KEY_SECRET")" | ||
| cp "${DEV_KEY_SECRET}.example" "$DEV_KEY_SECRET" | ||
| echo " Created DevKeySecret from example" |
There was a problem hiding this comment.
DevKeySecret 使用相对路径会导致 CI 调用目录变化时失败
Line 132 依赖当前工作目录是仓库根目录;如果从其他目录调用脚本,这里会找不到目标路径。并且 Line 135 在 .example 缺失时会直接中断整个脚本(set -e)。建议改成基于脚本位置解析仓库根目录,并显式校验模板文件存在。
🔧 建议修复
# ─── DevKeySecret (CI-only placeholder) ───
-DEV_KEY_SECRET="entry/src/main/ets/config/DevKeySecret.ets"
-if [ ! -f "$DEV_KEY_SECRET" ]; then
- mkdir -p "$(dirname "$DEV_KEY_SECRET")"
- cp "${DEV_KEY_SECRET}.example" "$DEV_KEY_SECRET"
+REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
+DEV_KEY_SECRET="$REPO_ROOT/entry/src/main/ets/config/DevKeySecret.ets"
+DEV_KEY_SECRET_EXAMPLE="${DEV_KEY_SECRET}.example"
+if [ ! -f "$DEV_KEY_SECRET" ]; then
+ if [ ! -f "$DEV_KEY_SECRET_EXAMPLE" ]; then
+ echo "❌ Missing template: $DEV_KEY_SECRET_EXAMPLE" >&2
+ exit 1
+ fi
+ mkdir -p "$(dirname "$DEV_KEY_SECRET")"
+ cp "$DEV_KEY_SECRET_EXAMPLE" "$DEV_KEY_SECRET"
echo " Created DevKeySecret from example"
fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ci/patch-sdk.sh` around lines 132 - 136, The DEV_KEY_SECRET path is
constructed relative to the current working directory which breaks when the
script is invoked from elsewhere; update the script to compute repository root
from the script location (e.g., use a SCRIPT_DIR or REPO_ROOT derived from
$(dirname "$0")/..), then set DEV_KEY_SECRET to that absolute path (use the
unique variable name DEV_KEY_SECRET). Before copying, explicitly check that the
template file "${DEV_KEY_SECRET}.example" exists and fail with a clear error
message if it does not (instead of letting set -e cause an opaque crash); still
create parent directories with mkdir -p "$(dirname "$DEV_KEY_SECRET")" and only
then cp the example into DEV_KEY_SECRET.
- GCK helper 函数移入 #if GAME_CONTROLLER_KIT_AVAILABLE 条件编译块 - ScanKit/ShareKit SDK stubs (kit_configs + ohos 模块 + declare module) - DevKeySecret 自动生成 - catch(e) 类型修复: JSON.stringify(e) → String(e) - VirtualKeyboard 回调移除 void 返回类型注解 - VirtualKeyboard 包裹 Column 容器(恢复旧写法)
5f2715c to
ca07c9f
Compare
- 回退 game_controller_native.cpp 条件编译改动 - 回退 QrShareService/CustomKeyOverlay catch 类型改动 - 回退 StreamPage VirtualKeyboard Column包裹改动 - CI workflow 改为 assembleHar 仅构建 nativelib 模块 - 移除 HAP/APP 签名构建和 Release 产物上传
- RegisterAllInputMonitors/UnregisterAllInputMonitors 使用 SAFE_CALL 宏 - TryLoadGameControllerLib 增加关键符号加载验证 - 缺失符号时记录警告日志而非崩溃
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
nativelib/src/main/cpp/game_controller_native.cpp (1)
1327-1351: 持锁期间调用回调存在潜在死锁风险。
GameController_HeartbeatCheck在持有g_mutex时调用g_deviceCallback和napi_call_threadsafe_function。如果回调函数尝试重新进入本模块(如调用getDeviceCount),将在同一线程上重复获取g_mutex导致死锁(std::mutex不可重入)。建议将断开设备的数据先收集到临时容器,释放锁后再发送回调:
♻️ 建议重构
// 检查缓存的设备是否仍然连接 std::vector<std::string> disconnectedIds; for (auto& pair : g_deviceInfos) { if (currentDevices.find(pair.first) == currentDevices.end()) { disconnectedIds.push_back(pair.first); } } - // 发送断开通知(在锁外执行以避免死锁) - // 注意: 这里我们释放锁后才发送回调 std::vector<std::pair<std::string, GameControllerInfo>> disconnectedDevices; for (const auto& deviceId : disconnectedIds) { auto it = g_deviceInfos.find(deviceId); if (it != g_deviceInfos.end()) { disconnectedDevices.push_back(*it); g_deviceInfos.erase(it); } g_deviceStates.erase(deviceId); disconnectedCount++; } + + // 解锁后再发送回调 + } // end of lock_guard scope - // 释放锁后发送回调 - // 注: 由于回调可能很快,这里简化处理,直接在锁内调用 - // 如果有问题可以改为在锁外调用 for (const auto& pair : disconnectedDevices) { // ... callback invocations ... }As per coding guidelines,
nativelib/src/main/cpp/**应关注线程安全。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nativelib/src/main/cpp/game_controller_native.cpp` around lines 1327 - 1351, In GameController_HeartbeatCheck, avoid calling g_deviceCallback and napi_call_threadsafe_function while holding g_mutex to prevent deadlocks; instead, copy the disconnectedDevices entries (or the minimal data: deviceId string and GameControllerInfo) into a temporary vector/local container while holding g_mutex, then release the mutex and iterate that temporary container to invoke g_deviceCallback (setting info.isConnected=false) and napi_call_threadsafe_function using g_tsfnDevice; ensure you preserve deviceId and info when copying and free any heap allocations used for napi events after the call.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/build.yml:
- Around line 336-339: The YAML at the end of the workflow contains orphaned
mapping keys — remove the standalone keys fail_on_unmatched_files, env and the
GITHUB_TOKEN entry (they are not under any job/step) so the workflow parses
correctly; keep the explanatory comment but delete those three lines or relocate
them under the appropriate step/job if intended, and ensure there are no other
top-level stray mapping entries.
---
Nitpick comments:
In `@nativelib/src/main/cpp/game_controller_native.cpp`:
- Around line 1327-1351: In GameController_HeartbeatCheck, avoid calling
g_deviceCallback and napi_call_threadsafe_function while holding g_mutex to
prevent deadlocks; instead, copy the disconnectedDevices entries (or the minimal
data: deviceId string and GameControllerInfo) into a temporary vector/local
container while holding g_mutex, then release the mutex and iterate that
temporary container to invoke g_deviceCallback (setting info.isConnected=false)
and napi_call_threadsafe_function using g_tsfnDevice; ensure you preserve
deviceId and info when copying and free any heap allocations used for napi
events after the call.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 53688fae-3448-4dfe-992d-df0a0de92959
📒 Files selected for processing (10)
.github/workflows/build.ymlci/patch-sdk.shci/sdk-stubs/kit.ScanKit.d.tsci/sdk-stubs/kit.ScanKit.jsonci/sdk-stubs/kit.ShareKit.d.tsci/sdk-stubs/kit.ShareKit.jsonci/sdk-stubs/ohos.scan.scanBarcode.d.tsci/sdk-stubs/ohos.scan.scanCore.d.tsci/sdk-stubs/ohos.share.systemShare.d.tsnativelib/src/main/cpp/game_controller_native.cpp
✅ Files skipped from review due to trivial changes (7)
- ci/sdk-stubs/kit.ScanKit.json
- ci/sdk-stubs/kit.ShareKit.json
- ci/sdk-stubs/ohos.scan.scanCore.d.ts
- ci/sdk-stubs/ohos.scan.scanBarcode.d.ts
- ci/sdk-stubs/kit.ScanKit.d.ts
- ci/sdk-stubs/kit.ShareKit.d.ts
- ci/sdk-stubs/ohos.share.systemShare.d.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- ci/patch-sdk.sh
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
nativelib/src/main/cpp/game_controller_native.cpp (1)
362-380: 符号验证逻辑合理,但注释略有出入注释说"验证所有按键/轴监听函数",但实际只检查了 11 个关键函数(共 22 个注册函数)。这是合理的关键路径检查,但如果日后维护者依赖此注释可能产生误解。
建议将注释改为"验证关键按键/轴监听函数"或补全检查列表。不影响功能。
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nativelib/src/main/cpp/game_controller_native.cpp` around lines 362 - 380, 注释不准确:注释写“验证所有按键/轴监听函数”,但代码只检查了关键函数(例如 OH_GamePad_ButtonA_RegisterButtonInputMonitor、OH_GamePad_RightTrigger_RegisterAxisInputMonitor 等 11 个符号);请将注释改为“验证关键按键/轴监听函数”或等价表述以反映实际行为,或者把缺失的注册函数(其余约 11 个注册符号)也加入 CHECK_FUNC 列表以实现真正的“全部检查”;更新 game_controller_native.cpp 中该注释/检查块以保持描述与实现一致。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nativelib/src/main/cpp/game_controller_native.cpp`:
- Around line 798-801: The StopMonitor path has a race because NapiStopMonitor
calls GameController_StopMonitor() without taking g_mutex; create a locked
internal wrapper to ensure thread-safety: implement a new function
GameController_StopMonitorLocked() that acquires g_mutex, performs the current
StopMonitor logic (modify g_monitoring, g_inputPaused, call
UnregisterAllInputMonitors, etc.), then releases g_mutex; change NapiStopMonitor
to call GameController_StopMonitorLocked(); keep existing callers that already
hold g_mutex calling the original GameController_StopMonitor() (or rename the
unlocked version to GameController_StopMonitorUnlocked) to avoid double-locking,
and update comments accordingly referencing UnregisterAllInputMonitors,
GameController_StopMonitor, NapiStopMonitor, StartMonitor, PauseInputMonitor,
ResumeInputMonitor.
---
Nitpick comments:
In `@nativelib/src/main/cpp/game_controller_native.cpp`:
- Around line 362-380: 注释不准确:注释写“验证所有按键/轴监听函数”,但代码只检查了关键函数(例如
OH_GamePad_ButtonA_RegisterButtonInputMonitor、OH_GamePad_RightTrigger_RegisterAxisInputMonitor
等 11 个符号);请将注释改为“验证关键按键/轴监听函数”或等价表述以反映实际行为,或者把缺失的注册函数(其余约 11 个注册符号)也加入
CHECK_FUNC 列表以实现真正的“全部检查”;更新 game_controller_native.cpp 中该注释/检查块以保持描述与实现一致。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c8be783e-474b-4676-ac37-e07a63d5bc2f
📒 Files selected for processing (1)
nativelib/src/main/cpp/game_controller_native.cpp
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nativelib/src/main/cpp/game_controller_native.cpp (1)
907-928:⚠️ Potential issue | 🔴 Critical缺少
GameController_StopMonitorUnlocked的前向声明
GameController_Uninit()在第 913 行调用GameController_StopMonitorUnlocked(),但该函数直到第 1038 行才定义。由于该函数是 static,必须在使用前声明,否则编译会失败。在
GameController_Uninit()之前添加前向声明:+static void GameController_StopMonitorUnlocked(); + void GameController_Uninit(void) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nativelib/src/main/cpp/game_controller_native.cpp` around lines 907 - 928, The call to the static function GameController_StopMonitorUnlocked inside GameController_Uninit occurs before the function is defined, causing a compile error; add a forward declaration for the static function (e.g., static void GameController_StopMonitorUnlocked(); ) above the definition of GameController_Uninit so the compiler knows its signature when Uninit is compiled, ensuring the existing static linkage and function prototype match the actual definition later in the file.
🧹 Nitpick comments (1)
.github/workflows/build.yml (1)
304-320: 构建步骤修改符合模块配置。
- 步骤名改为 "Build Native" 符合实际用途
assembleHar与nativelib/hvigorfile.ts中的harTasks配置一致-p module=nativelib@default中的模块名和目标均与nativelib/oh-package.json5和nativelib/build-profile.json5匹配小建议:日志文件名
build-hap.log可考虑改为build-har.log或build-native.log以保持命名一致性。可选:重命名日志文件
node hvigorw.js assembleHar \ --mode module \ -p module=nativelib@default \ -p product=default \ -p buildMode="${BUILD_MODE}" \ --no-daemon \ --stacktrace \ - 2>&1 | tee build-hap.log + 2>&1 | tee build-native.log同步更新 artifact 上传路径(第 333 行):
path: | - build-hap.log + build-native.log🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build.yml around lines 304 - 320, The current workflow step "Build Native" runs hvigorw.js assembleHar and writes output to build-hap.log which mismatches the assembleHar/har naming; change the log filename used in that step from build-hap.log to a consistent name (e.g., build-har.log or build-native.log) in the node command invocation, and also update any downstream references to that artifact (the artifact upload/action that expects build-hap.log) so they point to the new filename; target the "Build Native" step and the artifact upload stage that references build-hap.log when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@nativelib/src/main/cpp/game_controller_native.cpp`:
- Around line 907-928: The call to the static function
GameController_StopMonitorUnlocked inside GameController_Uninit occurs before
the function is defined, causing a compile error; add a forward declaration for
the static function (e.g., static void GameController_StopMonitorUnlocked(); )
above the definition of GameController_Uninit so the compiler knows its
signature when Uninit is compiled, ensuring the existing static linkage and
function prototype match the actual definition later in the file.
---
Nitpick comments:
In @.github/workflows/build.yml:
- Around line 304-320: The current workflow step "Build Native" runs hvigorw.js
assembleHar and writes output to build-hap.log which mismatches the
assembleHar/har naming; change the log filename used in that step from
build-hap.log to a consistent name (e.g., build-har.log or build-native.log) in
the node command invocation, and also update any downstream references to that
artifact (the artifact upload/action that expects build-hap.log) so they point
to the new filename; target the "Build Native" step and the artifact upload
stage that references build-hap.log when making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 57873ef1-3d16-4058-93a5-4b7745b3165b
📒 Files selected for processing (2)
.github/workflows/build.ymlnativelib/src/main/cpp/game_controller_native.cpp
a0855b7 to
62e576e
Compare
- NapiStopMonitor 路径现在正确持有 g_mutex - Uninit 内部调用无锁版 GameController_StopMonitorUnlocked 避免死锁
变更内容
��� 愚人节彩蛋 - 负延迟串流™
#64FFDA��� 设置页修复
��� GCK 安全加固
RegisterAllInputMonitors/UnregisterAllInputMonitors增加SAFE_CALL空值保护TryLoadGameControllerLib增加 11 个关键符号加载验证,缺失时记录警告GameController_StopMonitor竞态修复:分离加锁/无锁版本,NapiStopMonitor现在正确持有g_mutex��� CI & 工具链
.coderabbit.yaml)assembleHar nativelib)Summary by CodeRabbit
发布说明
新功能
改进
其他