Load multiple catalogs, can't make it work

Hi,

I have two remote catalogs with the same content. The second catalog may have some bundles more up to date then the first one.
When I do something like:

await Addressables.LoadContentCatalogAsync(catalogName1, true);
await Addressables.LoadContentCatalogAsync(catalogName2, true);

either I randomly get an error saying that the same asset bundle cannot be loaded once already loaded OR the updated bundles of catalog2 are not used at all.

please help me here to understand

  1. if this makes sense with the addressables logic
  2. if it should work like I am imagining to work

note that I don’t care about the delta download, I just want the new bundle to be downloaded and used if it’s newer than the one present in catalogName1.

Extra note:

my first mistake could be to assume that I would have one
ResourceLocationMap with the most updated content. I actually know now that this is not the case. I have a ResourceLocationMap per catalog with duplicated assets. I guess I have to do some manual check to know if the second ResourceLocationMap has more updated dependencies.

so yeah as you can see I have the locations from the local remote bundles:

and the location from the remote possibly updated bundles

both found in the locators inside Addressables.ResourceLocators

now my problem is is the most updated arena1 scene automatically loaded in memory? or they are both loaded? Eventually they can’t be both, since the asset name will be the same?
I could manually check which of the two is more updated and load only one, but I have no clue how to check if a bundle is more up to date than another through the locators. Investigating…

The problem I am trying to work out now is: if I have two remote catalogs with exactly the same bundles, I find in
Addressables.ResourceLocators duplicated IResourceLocation with dependencies coming from two different sources. I am trying to figure out how unity decides which of the two to use since the key is the same. For example:

in this case flat.png has a remote dependency, but there is exactly the same resourcelocator with the same key with another bundle location instead.

from what I see from this code, at glance it seems that it just select the first one it finds:

foreach (var locatorInfo in m_ResourceLocators)
            {
                var locator = locatorInfo.Locator;
                if (locator.Locate(key, t, out locs))
                {
                    foreach (var loc in locs)
                    {
                        var provider = ResourceManager.GetResourceProvider(typeof(TObject), loc);
                        if (provider != null)
                            return TrackHandle(ResourceManager.ProvideResource<TObject>(loc));
                    }
                }
            }

all I woudl need to do is to change this code to have some logic to prefer the second catalog over the first one if the hash doesn’t coincide. It’s a pretty specific logic that works only for our game, but it’s sad I don’t have a simple way to solve this.

A recap since now the situation is clearer. This is my problem:

if two catalogs contain the same key, the actual asset that is loaded in undefined. I would have expected a better approach to the problem.