A container registry that uses the AT Protocol for manifest storage and S3 for blob storage. atcr.io
docker container atproto go
80
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix listRecords call

+16 -7
+15 -6
pkg/hold/pds/crew.go
··· 1 1 package pds 2 2 3 3 import ( 4 + "bytes" 4 5 "context" 5 6 "fmt" 6 7 "time" ··· 43 44 } 44 45 45 46 // Create a new session for the next operation (old session is now closed) 46 - newSession, err := p.carstore.NewDeltaSession(ctx, p.uid, nil) 47 + rootStr := root.String() 48 + newSession, err := p.carstore.NewDeltaSession(ctx, p.uid, &rootStr) 47 49 if err != nil { 48 50 return cid.Undef, fmt.Errorf("failed to create new session: %w", err) 49 51 } ··· 83 85 var crew []*CrewRecord 84 86 85 87 err := p.repo.ForEach(ctx, CrewCollection, func(k string, v cid.Cid) error { 86 - // Get the full record 87 - path := fmt.Sprintf("%s/%s", CrewCollection, k) 88 - _, rec, err := p.repo.GetRecord(ctx, path) 88 + // Get the record bytes and decode manually (indigo doesn't know our custom type) 89 + _, recBytes, err := p.repo.GetRecordBytes(ctx, k) 89 90 if err != nil { 90 91 return err 91 92 } 92 93 93 - if crewRecord, ok := rec.(*CrewRecord); ok { 94 - crew = append(crew, crewRecord) 94 + // Decode the CBOR bytes into our CrewRecord type 95 + var crewRecord CrewRecord 96 + if err := crewRecord.UnmarshalCBOR(bytes.NewReader(*recBytes)); err != nil { 97 + return err 95 98 } 96 99 100 + crew = append(crew, &crewRecord) 97 101 return nil 98 102 }) 99 103 100 104 if err != nil { 105 + // If the collection doesn't exist yet (empty repo or no records created), 106 + // return empty list instead of error 107 + if err.Error() == "mst: not found" { 108 + return []*CrewRecord{}, nil 109 + } 101 110 return nil, fmt.Errorf("failed to list crew members: %w", err) 102 111 } 103 112
+1 -1
pkg/hold/pds/xrpc.go
··· 362 362 return 363 363 } 364 364 365 - w.Header().Set("Content-Type", "application/did+json") 365 + w.Header().Set("Content-Type", "application/json") 366 366 json.NewEncoder(w).Encode(doc) 367 367 } 368 368