Skip to content

Fix Snapshot tab hang when snapshots in different realms share a name#4744

Open
allister-beamable wants to merge 3 commits into
mainfrom
fix/snapshot-list-duplicate-name-hang
Open

Fix Snapshot tab hang when snapshots in different realms share a name#4744
allister-beamable wants to merge 3 commits into
mainfrom
fix/snapshot-list-duplicate-name-hang

Conversation

@allister-beamable

Copy link
Copy Markdown
Contributor

Fixes #4743

Problem

The Snapshot tab of the Beam Content window hangs at "Loading snapshots" forever when two realm folders contain snapshots with the same file name. This happens routinely once "On Publish Auto Snapshot Type" is enabled and content is published to more than one realm, because every publish writes LastPublished-<manifestId>.json into that realm's snapshot folder.

Root cause, in ContentWindow_SnapshotManager.CacheSnapshots():

  • The shared and local snapshot lookups were built with ToDictionary(item => item.Name), and snapshot names are not unique across realm folders, so ToDictionary threw ArgumentException.
  • The method is invoked fire-and-forget (_ = CacheSnapshots();), so the exception was swallowed, and _gatheringSnapshots (cleared only on the method's last line) stayed true - which makes the window draw the "Loading snapshots" block on every repaint.

Fix

  • Key the shared/local snapshot lookups by file path, which is unique and matches how the adjacent _allSnapshots dictionary was already keyed. The lookups are only consumed via .Values, so no other behavior changes.
  • Clear _gatheringSnapshots in a finally block so no failure during the cache rebuild can wedge the tab again.
  • Changelog entry under [Unreleased].

Tests

Added ContentWindowSnapshotTests (editor editmode) covering the duplicate-name-across-realms case, path keying, and empty input. Ran locally via Unity batch mode: 3/3 passed.

🤖 Generated with Claude Code

Snapshot lookups in the Content window were keyed by snapshot name,
which is not unique across realm folders: auto snapshots are always
named LastPublished-<manifestId>, so publishing to a second realm
made ToDictionary throw on a duplicate key. The exception escaped a
fire-and-forget task and left _gatheringSnapshots stuck true, so the
tab drew "Loading snapshots" forever.

Key the lookups by file path (matching _allSnapshots) and clear the
loading flag in a finally block. Add editor unit tests for the
duplicate-name case.

Fixes #4743

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
allister-beamable and others added 2 commits July 8, 2026 11:03
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Lightbeam link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant