Skip to content

FIX: Adding [NonSerialized] to layouts (struct RemoteSender)#2396

Open
josepmariapujol-unity wants to merge 2 commits intodevelopfrom
input/warning-fix-6.5
Open

FIX: Adding [NonSerialized] to layouts (struct RemoteSender)#2396
josepmariapujol-unity wants to merge 2 commits intodevelopfrom
input/warning-fix-6.5

Conversation

@josepmariapujol-unity
Copy link
Collaborator

@josepmariapujol-unity josepmariapujol-unity commented Mar 24, 2026

Description

Added [NonSerialized] to the layouts field at InputRemoting.cs:383. This suppresses the UAC1001 warning without touching InternedString or affecting runtime behavior, the field is purely transient state tracking which layouts were received from a remote sender.

Fixed 6000.6 editor warning:
Packages/com.unity.inputsystem/InputSystem/Devices/Remote/InputRemoting.cs(383,37): warning UAC1001: Field 'layouts' is a candidate for serialization but Unity will skip it because its type 'UnityEngine.InputSystem.Utilities.InternedString' lacks [Serializable] attribute. To fix this, either: make the field private (if serialization is not desired), add [System.NonSerialized] (to explicitly mark it as non-serialized), or add [Serializable] to type 'UnityEngine.InputSystem.Utilities.InternedString' (if serialization is desired).

Previous PR: #2381

Testing status & QA

No need to do manual testing.

Overall Product Risks

Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.

  • Complexity: 1
  • Halo Effect: 1

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@josepmariapujol-unity josepmariapujol-unity self-assigned this Mar 24, 2026
@josepmariapujol-unity josepmariapujol-unity marked this pull request as ready for review March 24, 2026 12:12
@josepmariapujol-unity josepmariapujol-unity changed the title FIX: Adding [NonSerialized] to layouts FIX: Adding [NonSerialized] to layouts (struct RemoteSender) Mar 24, 2026
Copy link
Contributor

@u-pr u-pr bot left a comment

Choose a reason for hiding this comment

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

Great
The PR is of great quality overall. A potential issue was identified regarding the serialization of the layouts field in the RemoteSender struct, which could lead to resource leaks during domain reloads.

🤖 Helpful? 👍/👎

@codecov-github-com
Copy link

codecov-github-com bot commented Mar 24, 2026

Codecov Report

All modified and coverable lines are covered by tests ✅

@@            Coverage Diff            @@
##           develop    #2396    +/-   ##
=========================================
  Coverage    77.90%   77.91%            
=========================================
  Files          476      482     +6     
  Lines        97613    97756   +143     
=========================================
+ Hits         76048    76163   +115     
- Misses       21565    21593    +28     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.30% <ø> (-0.23%) ⬇️
inputsystem_MacOS_2022.3_project 75.35% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.0 5.27% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.0_project 77.26% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.3 5.27% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.3_project 77.25% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.4 5.28% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.4_project 77.27% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.5 5.28% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.5_project 77.26% <ø> (-0.05%) ⬇️
inputsystem_MacOS_6000.6 5.28% <ø> (-0.04%) ⬇️
inputsystem_MacOS_6000.6_project 77.26% <ø> (-0.05%) ⬇️
inputsystem_Ubuntu_2022.3_project 75.15% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.0 5.28% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.06% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.3 5.28% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.06% <ø> (-0.05%) ⬇️
inputsystem_Ubuntu_6000.4 5.28% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.4_project 77.07% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.5 5.28% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.06% <ø> (-0.05%) ⬇️
inputsystem_Ubuntu_6000.6 5.28% <ø> (-0.04%) ⬇️
inputsystem_Ubuntu_6000.6_project 77.06% <ø> (-0.05%) ⬇️
inputsystem_Windows_2022.3 5.30% <ø> (-0.23%) ⬇️
inputsystem_Windows_2022.3_project 75.48% <ø> (-0.05%) ⬇️
inputsystem_Windows_6000.0 5.27% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.0_project 77.38% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.3 5.27% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.3_project 77.38% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.4 5.28% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.4_project 77.39% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.5 5.28% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.5_project 77.38% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.6 5.28% <ø> (-0.04%) ⬇️
inputsystem_Windows_6000.6_project 77.39% <ø> (-0.04%) ⬇️

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

Files with missing lines Coverage Δ
...system/InputSystem/Devices/Remote/InputRemoting.cs 81.32% <ø> (ø)

... and 8 files with indirect coverage changes

ℹ️ Need help interpreting these results?

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