fix: 战报先显示并在后台完成串流收尾#25
Conversation
- 退出串流时先显示战报,再后台停止串流和后台保活 - 退出游戏时先显示战报,再后台执行 quitGame 与锁屏等待 - 关闭战报前等待后台收尾,避免返回过早 - 抽取锁屏/等待/后台任务辅助方法,简化退出流程
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 Walkthrough概览StreamPage 的流关闭逻辑被重构为解耦UI回收与后台停止/退出工作。新增待机状态追踪防止重复调用,报告启用时立即恢复UI控制权,实际停止工作在后台并发执行。 变更流关闭流程解耦重构
审查工作量估计🎯 4 (复杂) | ⏱️ ~50 分钟 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
entry/src/main/ets/pages/StreamPage.ets (1)
767-772:⚠️ Potential issue | 🟠 Major | ⚡ Quick win断开/退游前先关闭菜单对话框。
现在这两个回调直接进入“先显示战报”的流程,但没有先关掉
gameMenuDialogController。页面不再立刻离开后,菜单可能继续压在战报上层,挡住点击。♻️ 建议修改
onDisconnect: () => { + this.gameMenuDialogController?.close(); this.stopStreaming(); }, onQuitGame: () => { + this.gameMenuDialogController?.close(); this.quitGameAndReturn(); },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@entry/src/main/ets/pages/StreamPage.ets` around lines 767 - 772, 在 onDisconnect 和 onQuitGame 回调里,在执行 stopStreaming() / quitGameAndReturn() 之前先关闭菜单对话框:调用页面上的 gameMenuDialogController 的关闭方法(例如 close()/dismiss()/closeDialog(),取决于该控制器实现),确保在调用 this.stopStreaming() 和 this.quitGameAndReturn() 之前等待或同步执行关闭操作以避免菜单仍然覆盖战报或阻挡点击。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@entry/src/main/ets/pages/StreamPage.ets`:
- Around line 1454-1458: closeStreamReportAndReturn currently can be entered
concurrently from onBackPress and StreamSessionReport.onClose, causing multiple
router.back() calls; add a one-time guard boolean (e.g.
this.isClosingStreamReport) checked at the start of closeStreamReportAndReturn
and set to true immediately so subsequent calls return early, and only clear the
flag if the exit fails (or leave it true if navigation succeeds) to ensure
router.back() is invoked exactly once; update closeStreamReportAndReturn and any
call sites (onBackPress, StreamSessionReport.onClose) to rely on this guard.
---
Outside diff comments:
In `@entry/src/main/ets/pages/StreamPage.ets`:
- Around line 767-772: 在 onDisconnect 和 onQuitGame 回调里,在执行 stopStreaming() /
quitGameAndReturn() 之前先关闭菜单对话框:调用页面上的 gameMenuDialogController 的关闭方法(例如
close()/dismiss()/closeDialog(),取决于该控制器实现),确保在调用 this.stopStreaming() 和
this.quitGameAndReturn() 之前等待或同步执行关闭操作以避免菜单仍然覆盖战报或阻挡点击。
🪄 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: 05cf455d-d706-4993-b38c-c92c032f4461
📒 Files selected for processing (1)
entry/src/main/ets/pages/StreamPage.ets
Summary
Validation
entry/src/main/ets/pages/StreamPage.etspassedhvigorw assembleHap --mode module -p product=default --no-daemonpassedSummary by CodeRabbit