Skip to content

fix: NetworkVariable change prior to ownership change using distributed authority topology fails to sync NetworkVariable - #4107

Open
NoelStephensUnity wants to merge 3 commits into
develop-2.0.0from
fix/UUM-148291/networkvariable-change-before-ownership-change
Open

fix: NetworkVariable change prior to ownership change using distributed authority topology fails to sync NetworkVariable#4107
NoelStephensUnity wants to merge 3 commits into
develop-2.0.0from
fix/UUM-148291/networkvariable-change-before-ownership-change

Conversation

@NoelStephensUnity

@NoelStephensUnity NoelStephensUnity commented Jul 27, 2026

Copy link
Copy Markdown
Member

Purpose of this PR

This resolves the issue where in a distributed authority session changing a NetworkVariable prior to changing ownership in the same call-stack would result in the NetworkVariable not being synchronized.

Jira ticket

UUM-148291

Changelog

  • Fixed: Issue where in a distributed authority session changing a NetworkVariable prior to changing ownership in the same call-stack would result in the NetworkVariable not being synchronized.

Documentation

  • No documentation changes or additions were necessary.

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

Functional Testing

Manual testing :

Automated tests:

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

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 will require an up-port.

Backports

No backport is required.

This resolves the issue where in a distributed authority session changing a NetworkVariable prior to changing ownership in the same call-stack would result in the NetworkVariable not being synchronized.
Removing the additional authority check as it is not needed.
Fixing a very edge case scenario that shouldn't happen but in the event it does when finding objects by type within a specific scene, if the scene is invalid then use an empty array for the found objects.
@codecov-github-com

codecov-github-com Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

@@              Coverage Diff               @@
##           develop-2.0.0    #4107   +/-   ##
==============================================
  Coverage          73.88%   73.89%           
==============================================
  Files                172      172           
  Lines              28013    28020    +7     
==============================================
+ Hits               20698    20705    +7     
  Misses              7315     7315           
Flag Coverage Δ
NGOv2_project_testproject_ubuntu_pinnedTrunk 73.68% <100.00%> (?)

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

Files with missing lines Coverage Δ
...ty.netcode.gameobjects/Runtime/Core/FindObjects.cs 84.31% <100.00%> (ø)
....netcode.gameobjects/Runtime/Core/NetworkObject.cs 74.98% <100.00%> (+0.09%) ⬆️
Components Coverage Δ
com.unity.netcode.gameobjects 73.89% <100.00%> (+<0.01%) ⬆️

ℹ️ Need help interpreting these results?

@michalChrobot michalChrobot 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.

looks good from what I understand

@FelixWentworth-Unity FelixWentworth-Unity left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

checked changes against repro project - lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants