From e97e51a59c004f2680bb3a5db0b6465a11539631 Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Fri, 2 Jan 2026 09:12:13 -0600 Subject: [PATCH] don't run ensure in background in case of first push --- pkg/appview/middleware/registry.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/appview/middleware/registry.go b/pkg/appview/middleware/registry.go index a9d4e90..ea1dca0 100644 --- a/pkg/appview/middleware/registry.go +++ b/pkg/appview/middleware/registry.go @@ -293,13 +293,12 @@ func (nr *NamespaceResolver) Repository(ctx context.Context, name reference.Name // Auto-reconcile crew membership on first push/pull // This ensures users can push immediately after docker login without web sign-in // EnsureCrewMembership is best-effort and logs errors without failing the request - // Run in background to avoid blocking registry operations if hold is offline + // Run synchronously to ensure crew record exists before write access checks + // (returns quickly if already a member - hold returns 200/201) if holdDID != "" && nr.refresher != nil { slog.Debug("Auto-reconciling crew membership", "component", "registry/middleware", "did", did, "hold_did", holdDID) client := atproto.NewClient(pdsEndpoint, did, "") - go func(ctx context.Context, client *atproto.Client, refresher *oauth.Refresher, holdDID string) { - storage.EnsureCrewMembership(ctx, client, refresher, holdDID) - }(ctx, client, nr.refresher, holdDID) + storage.EnsureCrewMembership(ctx, client, nr.refresher, holdDID) } // Get service token for hold authentication (only if authenticated)