diff --git a/pkg/appview/handlers/attestation_details.go b/pkg/appview/handlers/attestation_details.go index a2f5d57..ed67760 100644 --- a/pkg/appview/handlers/attestation_details.go +++ b/pkg/appview/handlers/attestation_details.go @@ -263,10 +263,13 @@ func fetchLayersFromPDS(ctx context.Context, pdsEndpoint, did, attestationDigest // Two-hop flow: (1) get presigned URL from hold, (2) fetch blob from S3. // serviceToken is optional — pass "" for public holds. func fetchLayerBlob(ctx context.Context, holdEndpoint, layerDigest, serviceToken string) ([]byte, error) { - holdURL := atproto.ResolveHoldURL(holdEndpoint) + holdURL, err := atproto.ResolveHoldURL(ctx, holdEndpoint) + if err != nil { + return nil, fmt.Errorf("could not resolve hold endpoint %s: %w", holdEndpoint, err) + } holdDID := atproto.ResolveHoldDIDFromURL(holdEndpoint) - if holdURL == "" || holdDID == "" { - return nil, fmt.Errorf("could not resolve hold endpoint: %s", holdEndpoint) + if holdDID == "" { + return nil, fmt.Errorf("could not resolve hold DID from: %s", holdEndpoint) } // Step 1: Request presigned URL from hold diff --git a/pkg/appview/handlers/delete.go b/pkg/appview/handlers/delete.go index cbe8bc9..16b17fb 100644 --- a/pkg/appview/handlers/delete.go +++ b/pkg/appview/handlers/delete.go @@ -196,8 +196,7 @@ func (h *DeleteAccountHandler) deleteFromHolds(ctx context.Context, user *db.Use // deleteFromSingleHold deletes user data from a single hold func (h *DeleteAccountHandler) deleteFromSingleHold(ctx context.Context, user *db.User, holdDID, relationship string) HoldDeleteResult { // Resolve hold DID to URL - holdURL := atproto.ResolveHoldURL(holdDID) - endpoint := holdURL + "/xrpc/io.atcr.hold.deleteUserData" + holdURL, err := atproto.ResolveHoldURL(ctx, holdDID) result := HoldDeleteResult{ HoldDID: holdDID, @@ -205,6 +204,14 @@ func (h *DeleteAccountHandler) deleteFromSingleHold(ctx context.Context, user *d Status: "failed", } + if err != nil { + slog.Warn("Failed to resolve hold URL for deletion", "holdDid", holdDID, "error", err) + result.Error = fmt.Sprintf("Failed to resolve hold URL: %v", err) + return result + } + + endpoint := holdURL + "/xrpc/io.atcr.hold.deleteUserData" + // Check if we have OAuth refresher (needed for service tokens) if h.Refresher == nil { result.Error = "OAuth not configured - cannot authenticate to hold" diff --git a/pkg/appview/handlers/device.go b/pkg/appview/handlers/device.go index 7bed18f..e72e8b2 100644 --- a/pkg/appview/handlers/device.go +++ b/pkg/appview/handlers/device.go @@ -527,7 +527,7 @@ const deviceSuccessTemplate = `
Device {{.DeviceName}} has been successfully authorized.
You can now close this window and return to your terminal.
- +