Skip to content

FIX: [Port] [UUM-151403] [Input System] Fixed actions enabled during startup being disabled - #2500

Merged
josepmariapujol-unity merged 2 commits into
developfrom
input/uum-151403-actions-enabled-during-startup-disabled
Oct 29, 2026
Merged

josepmariapujol-unity merged 2 commits into
developfrom
input/uum-151403-actions-enabled-during-startup-disabled

Conversation

@unitydavidlo

@unitydavidlo unitydavidlo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Port of the Editor fix for UUM-151403. Actions enabled early in startup (e.g. in a SubsystemRegistration callback or an Entities system's OnCreate) were being disabled by the BeforeSceneLoad hook in InputActionState. It ran in the Editor with domain reload disabled and on every Player launch. Removed the hook and, with domain reload disabled, exiting Play Mode now removes the onActionChange and onActionControlsChanged callbacks added during Play Mode. Callbacks added in Edit Mode, or owned by a Unity object that still exists such as an open Editor window, are kept.

Testing status & QA

Added InputActionStatePlayModeTests, which enters real Play Mode with domain reload on and off. Ran locally in 6000.3.25f1 batchmode with -nographics:

  • New tests: 3 passed.
  • PlayMode suite: 1939 passed, 0 failed, 77 skipped.
  • EditMode suite: 81 passed, 12 failed, 1 skipped. The failures are UI tests that need a graphics device (InputActionsEditorTests, InputActionReferencePropertyDrawerEditorTests, CustomProcessorEnumTest), so need to see them on CI.

Overall Product Risks

  • Complexity: Low
  • Halo Effect: Medium, it changes what gets reset when entering Play Mode with domain reload disabled.

Comments to reviewers

  • The code is the same as the Editor fix, only the test path changed.
  • The hook here also reset everything in Players, not just in the Editor with domain reload disabled, so both cases are fixed by this.

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.

…y Mode with domain reload disabled and in Player builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@unitydavidlo
unitydavidlo requested review from Pauliusd01 and jfreire-unity and removed request for Pauliusd01 October 28, 2026 09:37

@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.

💡 Harness Review

Needs changes

The change removes the reset that disabled startup actions and adds callback cleanup on Play Mode exit, but the regression tests do not reliably select their intended reload configuration.

Reviewed commit 98fd21c

🤖 Helpful? 👍/👎


static void SetDomainReloadDisabled(bool disabled)
{
EditorSettings.enterPlayModeOptions = disabled

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.

P1

The disableDomainReload=true case still reloads the domain with the checked-in Unity 6000.0 settings, leaving s_EarlyAction null after ExitPlayMode. The project sets enterPlayModeOptionsEnabled to false, and SetDomainReloadDisabled only changes enterPlayModeOptions. Unity 6000.0 ignores those options until enterPlayModeOptionsEnabled is enabled. The assertion on s_EarlyAction.enabled then throws, and the callback test also runs with the wrong reload configuration. Save enterPlayModeOptionsEnabled alongside the existing options. Enable it when configuring the tests. Restore it in TearDown.

🤖 Helpful? 👍/👎

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in ae4c058, the tests now enable the enter play mode options and save and restore the enabled flag too.

…actually disabled on 6000.0, and fixed saving and restoring them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@unitydavidlo

Copy link
Copy Markdown
Collaborator Author

/review

@codecov-github-com

codecov-github-com Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 97.45763% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...nputSystem.Editor/InputActionStatePlayModeTests.cs 96.73% 3 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2500      +/-   ##
===========================================
+ Coverage    78.96%   79.01%   +0.04%     
===========================================
  Files          767      768       +1     
  Lines       140949   141125     +176     
===========================================
+ Hits        111305   111504     +199     
+ Misses       29644    29621      -23     
Flag Coverage Δ
inputsystem_MacOS_6000.0 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.0_project 77.57% <97.45%> (+0.06%) ⬆️
inputsystem_MacOS_6000.3 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.3_project 77.57% <97.45%> (+0.06%) ⬆️
inputsystem_MacOS_6000.6 5.30% <0.00%> (+<0.01%) ⬆️
inputsystem_MacOS_6000.6_project 77.63% <97.45%> (+0.06%) ⬆️
inputsystem_Ubuntu_6000.0 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.0_project 77.48% <97.45%> (+0.06%) ⬆️
inputsystem_Ubuntu_6000.3 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.3_project 77.48% <97.45%> (+0.06%) ⬆️
inputsystem_Ubuntu_6000.6 5.30% <0.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.6_project 77.54% <97.45%> (+0.06%) ⬆️
inputsystem_Windows_6000.0 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.0_project 77.69% <97.45%> (+0.06%) ⬆️
inputsystem_Windows_6000.3 5.31% <0.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.3_project 77.70% <97.45%> (+0.06%) ⬆️
inputsystem_Windows_6000.6 5.30% <0.00%> (+<0.01%) ⬆️
inputsystem_Windows_6000.6_project 77.76% <97.45%> (+0.06%) ⬆️

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

Files with missing lines Coverage Δ
...InputSystem/Editor/InputSystemEditorInitializer.cs 74.92% <100.00%> (+2.30%) ⬆️
...em/InputSystem/Runtime/Actions/InputActionState.cs 92.56% <100.00%> (+0.39%) ⬆️
...nputSystem.Editor/InputActionStatePlayModeTests.cs 96.73% <96.73%> (ø)

... and 5 files with indirect coverage changes

ℹ️ Need help interpreting these results?

@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.

💡 Harness Review

Ship it

The change removes the startup action-state reset and adds callback cleanup when leaving Play Mode. I examined initialization order, callback subscription lifetimes, and the new domain-reload tests, and found no new actionable issues.

Reviewed commit ae4c058

⚠️ Earlier blocking findings with unresolved threads: 1. The rating above does not cover them; resolve each thread after addressing it.

🤖 Helpful? 👍/👎

@josepmariapujol-unity
josepmariapujol-unity merged commit 54b1581 into develop Oct 29, 2026
66 of 69 checks passed
@josepmariapujol-unity
josepmariapujol-unity deleted the input/uum-151403-actions-enabled-during-startup-disabled branch October 29, 2026 15:13
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