Skip to content

Content window Snapshot tab hangs at 'Loading snapshots' when snapshots in different realms share a name #4743

Description

@allister-beamable

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

  1. In Content Settings, set "On Publish Auto Snapshot Type" to Both (or Shared).
  2. Publish content to realm A.
  3. Switch realms and publish content to realm B. There are now two LastPublished-global.json files, one per realm folder.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpublic-buga bug report submitted by the community

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions