Fix Snapshot tab hang when snapshots in different realms share a name#4744
Open
allister-beamable wants to merge 3 commits into
Open
Fix Snapshot tab hang when snapshots in different realms share a name#4744allister-beamable wants to merge 3 commits into
allister-beamable wants to merge 3 commits into
Conversation
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>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Lightbeam link |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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>.jsoninto that realm's snapshot folder.Root cause, in
ContentWindow_SnapshotManager.CacheSnapshots():ToDictionary(item => item.Name), and snapshot names are not unique across realm folders, soToDictionarythrewArgumentException._ = CacheSnapshots();), so the exception was swallowed, and_gatheringSnapshots(cleared only on the method's last line) stayedtrue- which makes the window draw the "Loading snapshots" block on every repaint.Fix
_allSnapshotsdictionary was already keyed. The lookups are only consumed via.Values, so no other behavior changes._gatheringSnapshotsin afinallyblock so no failure during the cache rebuild can wedge the tab again.[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