Skip to content

fix: Reset NetworkClient upon shutdown [Backport] #3494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

NoelStephensUnity
Copy link
Collaborator

This PR addresses some NetworkManager instance clean up when shutdown including the ConnectionManager's NetworkClient.
This PR also includes a clean up for NetworkObject upon despawning in the event one is using an object pool.

MTT-12384

Changelog

  • Fixed: Issue where NetworkClient could persist some settings if re-using the same NetworkManager instance.
  • Fixed: Issue where a pooled NetworkObject was not resetting the internal latest parent property when despawned.

Testing and Documentation

  • Includes integration test updates.
  • No documentation changes or additions were necessary.

Backport

This is a back port of #3491.

Apply fixes from #3491
Adding tests to validate the fixes.
adding change log entries.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review June 9, 2025 21:57
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner June 9, 2025 21:57
@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) June 9, 2025 21:59
@NoelStephensUnity NoelStephensUnity merged commit c065fec into develop Jun 10, 2025
42 checks passed
@NoelStephensUnity NoelStephensUnity deleted the fix/reset-networkclient-completely-upon-shutdown-backport branch June 10, 2025 21:18
NoelStephensUnity added a commit that referenced this pull request Jun 10, 2025
This PR addresses some NetworkManager instance clean up when shutdown
including the ConnectionManager's NetworkClient.
This PR also includes a clean up for NetworkObject upon despawning in
the event one is using an object pool.

[MTT-12384](https://jira.unity3d.com/browse/MTT-12384)

## Changelog

- Fixed: Issue where `NetworkClient` could persist some settings if
re-using the same `NetworkManager` instance.
- Fixed: Issue where a pooled `NetworkObject` was not resetting the
internal latest parent property when despawned.

## Testing and Documentation

- Includes integration test updates.
- No documentation changes or additions were necessary.

<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->

## Backport
This requires a back port for pertinent/similar areas. (#3494)

<!-- If this is a backport:
 - Add the following to the PR title: "\[Backport\] ..." .
 - Link to the original PR.
If this needs a backport - state this here
If a backport is not needed please provide the reason why.
If the "Backports" section is not present it will lead to a CI test
failure.
-->
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