Skip to content

Conversation

@NoelStephensUnity
Copy link
Member

@NoelStephensUnity NoelStephensUnity commented Feb 10, 2026

There is ONE test issue to still address

This is a regression bug introduced in #3799

Purpose of this PR

This PR fixes the issue where NetworkVariable was not properly synchronizing to changes made by the spawn and write authority during OnNetworkSpawn and OnNetworkPostSpawn.

Jira ticket

NA - yet.
fix: #3876

Changelog

  • Fixed: Issue where NetworkVariable was not properly synchronizing to changes made by the spawn and write authority during OnNetworkSpawn and OnNetworkPostSpawn.

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
    • Used local project and test project.

Automated tests:

  • Covered by new automated tests
    • NetworkVariableGeneralTests

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.

Backports

This does not require a backport.

Fixing the issue with the missing `OnSpawned` override within `NetworkVariable`.
Adding a general test for scenarios like this one.
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner February 10, 2026 22:06
@NoelStephensUnity NoelStephensUnity added the regression The issue is a regression (something that was working in previous version) label Feb 10, 2026
Adding changelog entry.
Adding comments for clarity of what `OnSpawned` and the call to `PostNetworkVariableWrite` is for.
Removing trailing whitespaces.
Just apply the changes to the NetworkVariable instance and not all NetworkVariables of the NetworkBehaviour.
correcting the comment.
Very similar to NetworkList (we might collapse the OnSpawned logic into NetworkVariableBase.
OwnerModifiedTests was not properly spawning from the non-session owner client (it was spawning with ownership on the session owner side).

NetworkVariableCollectionTests is showing an issue with changes for only the host instance and only within the TestDictionaryCollections (has to do with trying to add and then reverting vs the tracked changes).
Narrowed down the issue to the changes tracked (i.e. added, removed, changed, unchanged) not matching when running a host but when comparing the actual dictionaries that all passes...
Removing developer logging.
@michalChrobot
Copy link
Member

Are you sure you linked the correct PR as the regression root? (you linked CoreCLR update)

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

Labels

regression The issue is a regression (something that was working in previous version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NetworkVariable modified in OnNetworkSpawn (Server) sends default value in initial CreateObjectMessage

2 participants