Skip to content

Unregistering a named Message Handler during the callback throws an Exception #3414

@SpyPlayer09

Description

@SpyPlayer09

Description

Unregistering a named Message Handler during the message callback throws a KeyNotFoundException originating in the CustomMessageManager.

Reproduce Steps

  1. Register a named Message Handler on the server and assign a named method as callback
  2. Request a connected client to send you a message under this name
  3. Deregister the Handler in the callback method itself
  4. Get a KeyNotFoundException after the callback has finished

Actual Outcome

Exception is thrown

Expected Outcome

No Exception is thrown

Screenshots

Image

Image

Environment

  • OS: [Windows 11]
  • Unity Version: [6000.0.45f1]
  • Netcode Version: [2.3.1]

Additional Context

It seems that at least in the latest release (2.3.1) the CustomMessageManager.cs file is not up to date with this repository. There already was a fix merged with [MTT-5380], but the changes are not applied in the current release source code. I checked both the unity cached version and downloaded the provided source.zip from the release. In both cases the class is in an older state missing the changes made in the mentioned PR.

Metadata

Metadata

Assignees

Labels

stat:importedStatus - Issue is tracked internally at Unitytype:bugBug Report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions