Skip to content

FIX: Input devices being lost up on upgrade to the new input version [ISX-2569]#2438

Merged
K-Tone merged 1 commit into
developfrom
anthony/isx-2569-fix-fepm-upgrade-device-loss
Jul 2, 2026
Merged

FIX: Input devices being lost up on upgrade to the new input version [ISX-2569]#2438
K-Tone merged 1 commit into
developfrom
anthony/isx-2569-fix-fepm-upgrade-device-loss

Conversation

@K-Tone

@K-Tone K-Tone commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Description

So the problem we're trying to fix here is that when you have a working project with pre-FEPM InputSystem and you then update the input package to the one that has the FEPM change, all input comes broken. The root problem appeared that all devices were lost during upgrade.

The reason devices got lost during upgrade is somewhat tricky to explain, but it all comes down to the fact that native will only communicate the current devices once per Unity process. If you lose devices once, it's permanent - entering playmode doesn't list devices again.

The way we lost devices was due to us renaming an in-memory scriptable object class that was used to keep state from InputSystemObject to InputSystemStateManager. Up on upgrade recompilation, Unity realised that the class for the InputSystemObject SO is no longer available so it shall be dropped, and all the devices died with it.

Hereby, we bring back the old class with the old meta info so that the forward upgrade can work for now.

Testing status & QA

Tried locally.

Overall Product Risks

  • Complexity: Low
  • Halo Effect: Low

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.

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perfect

Focused fix for a script GUID mismatch that ensures input devices survive the upgrade process.

🤖 Helpful? 👍/👎

@K-Tone K-Tone requested review from Pauliusd01 and ekcoh June 15, 2026 18:04
@codecov-github-com

codecov-github-com Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 5.55556% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...InputSystem/Editor/InputSystemEditorInitializer.cs 5.55% 17 Missing ⚠️
@@             Coverage Diff              @@
##           develop    #2438       +/-   ##
============================================
+ Coverage    58.58%   79.01%   +20.43%     
============================================
  Files          738      766       +28     
  Lines       135831   140426     +4595     
============================================
+ Hits         79570   110964    +31394     
+ Misses       56261    29462    -26799     
Flag Coverage Δ
inputsystem_MacOS_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 77.48% <5.55%> (+0.23%) ⬆️
inputsystem_MacOS_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 77.47% <5.55%> (+0.25%) ⬆️
inputsystem_MacOS_6000.4 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.4_project 77.49% <5.55%> (+0.25%) ⬆️
inputsystem_MacOS_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5_project 77.52% <5.55%> (+0.25%) ⬆️
inputsystem_MacOS_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.6_project 77.52% <5.55%> (+0.26%) ⬆️
inputsystem_Ubuntu_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.39% <5.55%> (+0.23%) ⬆️
inputsystem_Ubuntu_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.38% <5.55%> (+0.25%) ⬆️
inputsystem_Ubuntu_6000.4 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.4_project 77.39% <5.55%> (+0.26%) ⬆️
inputsystem_Ubuntu_6000.5 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.43% <5.55%> (+0.26%) ⬆️
inputsystem_Ubuntu_6000.6 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.6_project 77.43% <5.55%> (+0.26%) ⬆️
inputsystem_Windows_6000.0 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.0_project 77.60% <5.55%> (+0.22%) ⬆️
inputsystem_Windows_6000.3 5.31% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.3_project 77.60% <5.55%> (+0.25%) ⬆️
inputsystem_Windows_6000.4 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.4_project 77.60% <5.55%> (+0.25%) ⬆️
inputsystem_Windows_6000.5 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.5_project 77.65% <5.55%> (+0.25%) ⬆️
inputsystem_Windows_6000.6 5.30% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.6_project 77.65% <5.55%> (+0.25%) ⬆️

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

Files with missing lines Coverage Δ
...InputSystem/Editor/InputSystemEditorInitializer.cs 72.61% <5.55%> (+70.25%) ⬆️

... and 278 files with indirect coverage changes

ℹ️ Need help interpreting these results?

@ekcoh ekcoh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure I fully understand this fix but looks like fixing broken serialisation. The key takeaway here IMO is that this (not this PR; but how this work) is the wrong solution to the problem. I will link this issue/PR as a motivational case for why device ownership, enumeration, reconnects should live in the module (native) and not in the package. This would make this + any serialisation push/pop disappear from the package. Good fix!

@K-Tone

K-Tone commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the input Hakan! I would have totally loved if we could poll data from native at certain points instead of messing with ScriptableObjects. We do know keeping data is needed, just that if we keep copies in managed that appears to cost much more. I would have totally loved trying to minimise our managed state that needs to survive domain reload.

@Pauliusd01

Copy link
Copy Markdown
Collaborator

Just leaving my status that I am currently busy with our module port, it is unlikely to be checked this week

@K-Tone

K-Tone commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

Simply to have it said somewhere, I'm on a PTO in July so if it's not this week then either someone else will have to address feedback on this PR or still myself but in August.

@Pauliusd01

Copy link
Copy Markdown
Collaborator

I'll give it a go today

@Pauliusd01

Copy link
Copy Markdown
Collaborator

/test_plan

@Unity-Technologies Unity-Technologies deleted a comment from u-pr Bot Jul 1, 2026
@u-pr

u-pr Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Test Plan

  • Test plan approved by PR author
  • Test execution in progress
  • Test execution complete
  • Ready for merge

Summary of Changes & Risk Assessment

Summary of Changes

This PR addresses a critical bug [ISX-2569] where input devices were lost during package upgrades. The issue stemmed from renaming the internal state-tracking class from InputSystemObject to InputSystemStateManager. Because Unity native only reports devices once per process, losing the domain-reload-surviving ScriptableObject meant permanent loss of input until an Editor restart. This fix reintroduces the legacy InputSystemObject class and adds migration logic to transfer state to the new manager during initialization.

Risk Assessment

  • High Risk Areas: None identified.
  • Medium Risk Areas: Editor initialization sequence, domain reload persistence.
  • Low Risk Areas: Changelog, GUID consistency.

Test Scenarios

Functional Testing

  • Upgrade Migration Path: Install a version of the Input System prior to the FEPM changes (e.g., 1.7.0). Verify devices are working. Upgrade to the package version containing this PR. Verify that devices (Keyboard/Mouse/Gamepad) remain functional without restarting the Editor.
  • Data Integrity Check: Using a debugger or logs, verify that fields in InputSystemObject.cs:L28-L32 (systemState, settings, etc.) are correctly copied to the new InputSystemStateManager during the migration block in InputSystemEditorInitializer.cs:L178-L184.
  • Cleanup Verification: Verify that any detected InputSystemObject instances are successfully destroyed after migration (InputSystemEditorInitializer.cs:L188) and do not persist in memory across subsequent domain reloads.

Regression Testing

  • Standard Domain Reload: In a project already using this version, trigger a domain reload (e.g., by modifying a script). Verify that InputSystemStateManager continues to function normally and the legacy migration logic is skipped (as no legacy objects should exist).
  • Fast Enter Play Mode (FEPM): Verify that "Enter Play Mode Options" (Disable Domain Reload) still works as expected and does not conflict with the initialization logic in InitializeInEditor.
  • GUID Verification: Confirm the GUID in InputSystemObject.cs.meta matches 5cdce2bffd1e49bda08b3db54a031207 to ensure Unity recognizes the old serialized script references.

Edge Cases

  • Multiple Legacy Objects: If the Editor state is somehow corrupted and contains multiple InputSystemObject instances, verify the code handles this by migrating from the first and destroying all of them (InputSystemEditorInitializer.cs:L187-L189).

💡 This test plan updates automatically when /test_plan is run on new commits. If you have any feedback, please reach out in #ai-qa


🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

@Pauliusd01 Pauliusd01 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, checked upgrading, reimporting and did some basic fast enter play mode rechecks.

@K-Tone K-Tone force-pushed the anthony/isx-2569-fix-fepm-upgrade-device-loss branch from a8a5599 to b32a0f9 Compare July 1, 2026 13:51
@K-Tone K-Tone merged commit 61d8245 into develop Jul 2, 2026
107 checks passed
@K-Tone K-Tone deleted the anthony/isx-2569-fix-fepm-upgrade-device-loss branch July 2, 2026 06:46
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.

3 participants