Repository navigation
Conversation
Unity keeps a deleted asset's GUID until the editor closes, and the default AssetDatabase.AssetPathToGUID overload keeps returning it. Three existence checks used that overload, so a path freed this session still read as taken: - ManageAsset.AssetExists: move, duplicate, create and create_folder into the freed path were refused; get_info and import on it reported success. - ManageTexture.AssetExists: set_import_settings on a deleted texture reported success while doing nothing. - GameObjectModify: renaming an open prefab's root to the name of a prefab deleted this session was refused as a collision. Pass AssetPathToGUIDOptions.OnlyExistingAssets at all three. The option exists back to Unity 2021.3, so no compat shim is needed. 7 new EditMode tests, each seen failing on the old code for the reason above. Issue: #47 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
manage_assettreated an asset deleted earlier in the editor session as still there until the editor restarted. Moving, duplicating, creating or creating a folder at the freed path was refused with "already exists", andget_infoandimporton the deleted path reported success. Unity keeps a deleted asset's GUID for the rest of the session, and the defaultAssetDatabase.AssetPathToGUIDoverload keeps returning it. The existence checks now passAssetPathToGUIDOptions.OnlyExistingAssets.The same lookup had the same effect in two other places, and this PR fixes both:
manage_texture set_import_settingson a texture deleted this session reported success while doing nothing.manage_gameobject modifywithname) to the name of a prefab deleted this session was refused as a collision.The option exists back to Unity 2021.3, so no compat shim is needed. The change is C# only: the Python tool and CLI just forward the parameters.
Issue: #47
Upstream: not fixed on
upstream/main(v10.3.0) orupstream/beta(2026-10-17). Open upstream PRs CoplayDev#1459 and CoplayDev#1466 touchManageAsset.csbut not this check.Tests
DeletedAssetPathTestsand 1 inManagePrefabsStageTests. All 7 failed on the old code for the reasons above. Each first asserts that Unity still returns the deleted asset's GUID, so none can pass vacuously.Checks on this branch (
dd9aae6d)Not landed.
/landruns the version bump and the full gate.🤖 Generated with Claude Code