Skip to content

[GFX-722] 修复加载失败场景仍被标记已加载的字典缺陷 - #2

Merged
AlianBlank merged 1 commit into
mainfrom
feature/gfx-722
Aug 28, 2026
Merged

[GFX-722] 修复加载失败场景仍被标记已加载的字典缺陷#2
AlianBlank merged 1 commit into
mainfrom
feature/gfx-722

Conversation

@AlianBlank

@AlianBlank AlianBlank commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Linear: GFX-722

变更

  • Runtime/Scene/Scene/GameSceneManager.csOnLoadSceneCompleted 状态判定前置——前置计算 loadSucceed = IsDone && Status == Succeed,仅成功时把句柄写入 m_LoadedSceneAssetNames,成功/失败回调分支复用同一判定。
  • 加载失败的场景不再留下"幽灵"已加载记录:UnloadScene 不再对失败句柄走异常分支、同名场景重试不再被 "already loaded" 拦截、失败地址/句柄不再泄漏在字典中。
  • 成功路径行为完全不变(含 value == null 防御分支仍登记成功句柄);公共 API 无变化。

验证

  • mono csc 差分编译烟测(引用 YooAsset.Runtime / GameFrameX.Runtime / GameFrameX.Asset.Runtime / GameFrameX.Event.Runtime / UnityEngine.CoreModule / netstandard):原文件与修改后文件错误集完全一致(均恰好 9 个既有 Utility CS0103,源于本机引用集取自核心包未合并的 Utility 重构检出),零新增错误。
  • 逻辑复核:失败后 SceneIsLoaded == falseSceneIsLoading == false,同名场景可立即重试;UnloadScene 按 "not loaded yet" 正确抛错。
  • 待人工(本环境无法启动 Unity Editor):Editor 导入无编译报错;构造加载失败场景后 LoadSceneFailure 事件触发且 SceneIsLoaded 为 false。

关联

Fixes GFX-722

LayaBox / Cocos 侧经检索无同源拷贝,无需同步修复;Godot 仓尚未迁移 scene 模块。

Summary by CodeRabbit

  • Bug Fixes
    • 修复场景加载失败时仍被记录为已加载的问题。
    • 统一场景加载成功与失败回调中的状态结果,提升加载状态反馈准确性。

@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

GFX-722

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: acae1eaa-7d9f-41fe-9898-8352956bb6da

📥 Commits

Reviewing files that changed from the base of the PR and between 6a28b4a and f8c91ad.

📒 Files selected for processing (1)
  • Runtime/Scene/Scene/GameSceneManager.cs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

OnLoadSceneCompleted 现在只将成功加载的场景写入 m_LoadedSceneAssetNames。成功和失败回调均使用统一的 loadSucceed 结果。

Changes

场景加载状态处理

Layer / File(s) Summary
加载完成状态与回调处理
Runtime/Scene/Scene/GameSceneManager.cs
OnLoadSceneCompleted 仅在场景操作成功完成时更新已加载场景字典。回调分支复用 loadSucceed 结果。

Estimated code review effort: 1 (简单) | ~5 minutes

Merge Risk: ⚪ Minimal · up to f8c91

Failed scene loads are no longer recorded as loaded, while successful loading behavior and public APIs remain unchanged. The change is localized and merge-ready after normal checks, with no actionable merge-blocking risk remaining.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题明确描述了主要修复内容:避免场景加载失败后仍被标记为已加载。该内容与代码变更和 PR 目标一致。
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/gfx-722

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AlianBlank
AlianBlank merged commit b77ebc1 into main Aug 28, 2026
3 checks passed
github-actions Bot pushed a commit that referenced this pull request Aug 28, 2026
## [2.3.2](2.3.1...2.3.2) (2026-08-28)

### Bug Fixes

* **scene:** 修复加载失败场景仍被标记已加载的字典缺陷 ([#2](#2)) ([b77ebc1](b77ebc1))
@AlianBlank
AlianBlank deleted the feature/gfx-722 branch August 29, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant