Bug Using custom Addressable Name in "Google.Android.PerformanceTuner.AddressablesScenesEnumInfo.ConvertScenePathToProtoEnumEntry()"
- Dominant language
- C#
- Stars
- 62
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
Hey
I find having a scene called "System_Audio" fail when I'm trying to update the Addressables Settings scenes in ATP tab
here some images:


Issue Happens because method assumes addresable item contains extension file in their name
instead of doing this
```cs
// Use this function to get the protobuf Scene Enum entry corresponding to a scene.
public static string ConvertScenePathToProtoEnumEntry(string scenePath, bool isAddressableScene)
{
string sceneName = scenePath
.Replace(Path.DirectorySeparatorChar, '_')
.Replace(Path.AltDirectorySeparatorChar, '_')
.Replace(Path.GetExtension(scenePath), "")
.Replace(" ", "_")
.ToUpper();
sceneName = k_SceneFieldRegex.Replace(sceneName, "");
string prefix = isAddressableScene ? "ADDR_" : "";
return prefix + sceneName;
}
```
do this
```cs
// Use this function to get the protobuf Scene Enum entry corresponding to a scene.
public static string ConvertScenePathToProtoEnumEntry(string scenePath, bool isAddressableScene)
{
string sceneName = scenePath
.Replace(Path.DirectorySeparatorChar, '_')
.Replace(Path.AltDirectorySeparatorChar, '_')
.Replace(" ", "_")
.ToUpper();
// parche, en caso de que el item posea extension se la quitamos
if(Path.GetExtension(scenePath)?.Length > 0)
{
sceneName = sceneName.Replace(Path.GetExtension(scenePath), "");
}
else
{
// Fino mi pana 👍
}
sceneName = k_SceneFieldRegex.Replace(sceneName, "");
string prefix = isAddressableScene ? "ADDR_" : "";
return prefix + sceneName;
}
```
in this case, if addressable item does not have an extension it does not give you a zero lenght string, causing a false positive error
hope it helps :) !😎
Contributor guide
Research direction
Locate Google.Android.PerformanceTuner.AddressablesScenesEnumInfo.ConvertScenePathToProtoEnumEntry() and inspect how it handles addressable scene paths without file extensions. Reproduce the failure with an addressable item named System_Audio, then verify conversion succeeds without a false error while paths with extensions retain their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp, unity
- Domain
- game-dev, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100