Skip to content

fix: [Backport] Ensure all loaded scenes are registered on session owner promotion - #4217

Merged
EmandM merged 4 commits into
develop-2.0.0from
backport/fix/scene-validation-after-host-migration
Oct 30, 2026
Merged

EmandM merged 4 commits into
develop-2.0.0from
backport/fix/scene-validation-after-host-migration

Conversation

@EmandM

@EmandM EmandM commented Oct 26, 2026

Copy link
Copy Markdown
Member

Purpose of this PR

Backport of #4214

Currently, when a client starts the session as a DA session owner their NetworkSceneManger initializes all the existing loaded scenes so they can correctly synchronize incoming clients.

This PR ensures that clients promoted to session owner mid-session also initialize their existing loading scenes.

This fixes an error where an active scene that was loaded before the game started would break synchronization on late-joining clients after a new session owner was promoted.

Jira ticket

UUM-154485

Changelog

  • Fixed: Issue where a client promoted to session owner could throw an exception when synchronizing a newly joining client.

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Up-port

This is a backport of #4214

Backports

n/a

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Harness Review

Needs changes

The change is focused on session-owner promotion and active-scene synchronization, but the migration handling needs another pass.

Reviewed commit 4cb6c5a

🤖 Helpful? 👍/👎

@NoelStephensUnity NoelStephensUnity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@EmandM
EmandM enabled auto-merge (squash) October 30, 2026 16:58
@codecov-github-com

codecov-github-com Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...cts/Runtime/SceneManagement/NetworkSceneManager.cs 86.36% 3 Missing ⚠️
@@                Coverage Diff                @@
##           develop-2.0.0    #4217      +/-   ##
=================================================
+ Coverage          74.25%   74.27%   +0.02%     
=================================================
  Files                172      172              
  Lines              28274    28271       -3     
=================================================
+ Hits               20994    20998       +4     
+ Misses              7280     7273       -7     
Flag Coverage Δ
NGOv2_project_testproject_ubuntu 73.94% <88.46%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...cts/Runtime/Connection/NetworkConnectionManager.cs 82.21% <ø> (-0.02%) ⬇️
...netcode.gameobjects/Runtime/Core/NetworkManager.cs 79.62% <100.00%> (+0.09%) ⬆️
...me/Messaging/Messages/ConnectionApprovedMessage.cs 67.35% <ø> (+1.09%) ⬆️
...cts/Runtime/SceneManagement/NetworkSceneManager.cs 80.00% <86.36%> (+0.16%) ⬆️
Components Coverage Δ
com.unity.netcode.gameobjects 74.27% <88.88%> (+0.02%) ⬆️

ℹ️ Need help interpreting these results?

@EmandM
EmandM merged commit 34c377d into develop-2.0.0 Oct 30, 2026
26 checks passed
@EmandM
EmandM deleted the backport/fix/scene-validation-after-host-migration branch October 30, 2026 18:09
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.

2 participants