Skip to content

Conversation

@lyndon-unity
Copy link
Collaborator

Description

Reset now clears out old Input Action Assets and Input Action References first to avoid the InputManager.asset file growing in size over each reset

For bug https://jira.unity3d.com/browse/ISX-1839

Changes made

Spinning through contents of InputManager.asset to remove Input Action Assets and Input Action References first
Then using GetOrCreate to create a new version (to make sure only 1 added, if GetOrCreate called in a callback elsewhere - which it is due to AssetDatabase.SaveAssets call)

Notes

Checklist

Before review:

  • Changelog entry added.
  • Tests added/changed, if applicable.
  • None added on this instance, but opportunity to add one for this

During merge:

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

Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

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

LGTM, a minor comment about changelog.

- Fixed issue where composite part dropdown manipulates binding path and leaves composite part field unchanged.
- Fixed lingering highlight effect on Save Asset button after clicking.
- Fixed missing name in window title for Input Action assets.
- Fixed InputManager.asset file growing in size on each Reset call (ISX-1839)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: Missing full-stop in end. Referencing internal case ID for a non-publicly visible issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed (online in githib editor ;) )
Note: Some prior change log entries also seem to have some internal bug references but I've not changed those in this PR

@ekcoh
Copy link
Collaborator

ekcoh commented Jan 29, 2024

Seems like PR got hit by CI instability, rerun tests?

Removed internal bug id and added full stop
@lyndon-unity
Copy link
Collaborator Author

Seems like PR got hit by CI instability, rerun tests?

Re-running with minor changelog update.

Copy link
Collaborator

@ritamerkl ritamerkl left a comment

Choose a reason for hiding this comment

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

Just two little remarks on the comments, looks good, nice to have this fixed!

/// <summary>
/// Delete project wide input actions
/// </summary>
/// <param name="asset"></param>
Copy link
Collaborator

Choose a reason for hiding this comment

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

parameter left over in comment

/// <summary>
/// Reset project wide input actions asset
/// </summary>
/// <param name="asset"></param>
Copy link
Collaborator

Choose a reason for hiding this comment

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

unused param asset

…re we never create duplicates

Added Start/EndAssetEditing calls to try and make the serialisation code more atomic
Removed some unused param fields in the docs

Removed some excessiver SaveAssets calls
…Unity-Technologies/InputSystem into ISX_1839_reset_fix_to_remove_duplicates
@lyndon-unity
Copy link
Collaborator Author

Params documentation fixed - and moved delete into the create so that when new data created any old data is always cleaned out. This catches an extra case.

@lyndon-unity lyndon-unity requested a review from ekcoh January 31, 2024 12:55
Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

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

Approving but have one outstanding questions around the intended behavior in the DeleteActionAssetAndActionReferences() function regarding intended behavior to consider before merge.

else if (obj is InputActionAsset)
{
AssetDatabase.RemoveObjectFromAsset(obj);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if there is something here that isn't an InputActionReference or an InpuitAction asset?
I recommend we either throw or log an error or alternatively change the last else if into an unconditional else which would remove anything? Or is this designed to leave e.g. InputManager or any other root objects untouched?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Its designed to leave InputManager and others untouched

@lyndon-unity lyndon-unity merged commit a89c735 into develop Jan 31, 2024
@lyndon-unity lyndon-unity deleted the ISX_1839_reset_fix_to_remove_duplicates branch January 31, 2024 20:19
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.

4 participants