Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2019.4.30f1
2020.3
2021.1
2021.2
2022.1
Issue ID
1377465
Regression
No
AssetDatabase observes Package files when the Package has been removed using PackageManager Client.Remove
How to reproduce:
1. Open the attached project
2. Go to MyMenu/Do Stuff at the top of the Editor
3. Observe the Console
Expected result: "Packages/com.unity.2d.sprite/Editor/AssemblyInfo.cs" is logged to the Console only once, before the Package is removed
Actual result: "Packages/com.unity.2d.sprite/Editor/AssemblyInfo.cs" is logged to the Console two times, once after the Package should have been removed
Reproducible with: 2019.4.32f1, 2020.3.22f1, 2021.1.28f1, 2021.2.1f1, 2022.1.0a14
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Keywords on Material Variants aren't automatically saved when changed on original Material through Shader Graph
- Light Probes get baked when calling LightProbes.Tetrahedralize
- Shadows flicker and cause visual artifacts when modifying a GameObject's bounds using Swizzle (Y Mask) and Sine Time nodes
- [WebGL] Frame rate drops by 5-20 fps when moving cursor or touch input in the Player
- Light bleeds when using box shaped spotlight with specific Emission Range values
Resolution Note:
This is by design. The API is behaving correctly. I tested the script and the package was added and removed in the same editor tick. Any code before the end of the tick will not reflect the change. The package manager change is only effective when a full editor tick is completed. Sleeping the main thread (i.e. Thread.Sleep) only makes the current tick wait longer. The script could be altered to add/remove packages through sequential `EditorApplication.update` events.
We know the API is not the most user-friendly. We have plans to improve the API and make it more evident a tick yield is necessary for a package to be effectively added/removed/changed and reported by other API.