Description
A community user on Unity SDK 5.1.1 reported that the Snapshot tab of the Beam Content window hangs at "Loading snapshots" and never finishes. This happens after publishing content to more than one realm with "On Publish Auto Snapshot Type" set to Both (or Shared), because each publish writes an auto snapshot named LastPublished-global.json into that realm's .beamable/content-snapshots/<pid>/ folder - producing two snapshot files with the same name in different realm folders.
Steps to Reproduce
- In Content Settings, set "On Publish Auto Snapshot Type" to Both (or Shared).
- Publish content to realm A.
- Switch realms and publish content to realm B. There are now two
LastPublished-global.json files, one per realm folder.
- Open the Beam Content window and select the Snapshot tab.
Expected
The Snapshot tab lists the snapshots from all realm folders, including auto snapshots that share the file name LastPublished-global.json.
Actual
The Snapshot tab shows "Loading snapshots" indefinitely. Renaming either of the identically named snapshot files restores loading.
Root Cause
In ContentWindow_SnapshotManager.CacheSnapshots():
- The shared and local snapshot lookups are built with
ToDictionary(item => item.Name). Snapshot names are not unique across realm folders (auto snapshots are always LastPublished-<manifestId>), so ToDictionary throws ArgumentException on the duplicate key.
_gatheringSnapshots is set to true before the fetch and only cleared on the method's last line. The call is fire-and-forget (_ = CacheSnapshots();), so the exception is swallowed and the flag stays true, which makes ContentWindow draw the "Loading snapshots" block forever.
Fix
Key the snapshot lookups by file path (which is unique, and is already how the adjacent _allSnapshots dictionary is keyed), and clear _gatheringSnapshots in a finally block so a failure during the cache rebuild can no longer wedge the tab.
Description
A community user on Unity SDK 5.1.1 reported that the Snapshot tab of the Beam Content window hangs at "Loading snapshots" and never finishes. This happens after publishing content to more than one realm with "On Publish Auto Snapshot Type" set to Both (or Shared), because each publish writes an auto snapshot named
LastPublished-global.jsoninto that realm's.beamable/content-snapshots/<pid>/folder - producing two snapshot files with the same name in different realm folders.Steps to Reproduce
LastPublished-global.jsonfiles, one per realm folder.Expected
The Snapshot tab lists the snapshots from all realm folders, including auto snapshots that share the file name
LastPublished-global.json.Actual
The Snapshot tab shows "Loading snapshots" indefinitely. Renaming either of the identically named snapshot files restores loading.
Root Cause
In
ContentWindow_SnapshotManager.CacheSnapshots():ToDictionary(item => item.Name). Snapshot names are not unique across realm folders (auto snapshots are alwaysLastPublished-<manifestId>), soToDictionarythrowsArgumentExceptionon the duplicate key._gatheringSnapshotsis set totruebefore the fetch and only cleared on the method's last line. The call is fire-and-forget (_ = CacheSnapshots();), so the exception is swallowed and the flag staystrue, which makesContentWindowdraw the "Loading snapshots" block forever.Fix
Key the snapshot lookups by file path (which is unique, and is already how the adjacent
_allSnapshotsdictionary is keyed), and clear_gatheringSnapshotsin afinallyblock so a failure during the cache rebuild can no longer wedge the tab.