Handle failed group loads with shell groups and build issues - #46
Merged
Merged
Conversation
An add whose load failed could leave nothing behind at all: the shell group row was only written after `resolveGroupTarget` had fetched the document and its latest version, so a version-less document (or any Onshape hiccup in those two calls) produced an add that silently did nothing. When the row did survive, nothing marked it as failed, and the duplicate check on POST /group blocked re-adding the document either way — leaving no way to tell whether the group was in the library. Write the shell group first, using the name the route already fetched, and record a LOAD_FAILED build issue on the group when a load throws, in both the add and reload workflows. A later successful load recomputes `buildIssues` and clears it. Surface that state: `GroupOut.isLoaded` dims a never-loaded group's title in the library list, and its page says it failed to load rather than that it has no visible elements. A group with no pinned version now links to the document instead of a `/v/placeholder` that 404s.
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.
Summary
This change improves handling of failed group loads by introducing "shell groups" - placeholder group records that persist even when their initial load fails. Failed groups are now flagged with a build issue so users understand why a group appears empty, and can retry or delete it.
Key Changes
LOAD_FAILEDbuild issue is recorded on the group, which displays to users instead of silently showing an empty groupisLoadedboolean toGroupOutto distinguish between shell groups (never loaded) and fully loaded groupsDocumentPathinstead ofInstancePathsince they don't have a pinned version yetImplementation Details
PLACEHOLDER_VERSION_IDconstant extracted to schema for reuse across the codebasecreateShellGroupnow runs before attempting to load, ensuring the group persists even if load failsflagFailedGroupfunction records the failure by adding a build issue to the group recordDocumentPathandInstancePathfor group pathshttps://claude.ai/code/session_01Xda9Sd1YsAQZiEeQRN7hC7