this repo has no description
0
fork

Configure Feed

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

Remove commit from getRecord since there's no repo history anymore (#423)

authored by

Jaz and committed by
GitHub
d3d9ea33 3f7c1d32

+4 -20
+1
backfill/backfill_test.go
··· 32 32 ts := &testState{} 33 33 34 34 opts := backfill.DefaultBackfillOptions() 35 + opts.CheckoutPath = "https://bsky.network/xrpc/com.atproto.sync.getRepo" 35 36 opts.NSIDFilter = "app.bsky.feed.follow/" 36 37 37 38 bf := backfill.NewBackfiller(
+2 -11
bgs/handlers.go
··· 22 22 "github.com/labstack/echo/v4" 23 23 ) 24 24 25 - func (s *BGS) handleComAtprotoSyncGetRecord(ctx context.Context, collection string, commit string, did string, rkey string) (io.Reader, error) { 25 + func (s *BGS) handleComAtprotoSyncGetRecord(ctx context.Context, collection string, did string, rkey string) (io.Reader, error) { 26 26 u, err := s.lookupUserByDid(ctx, did) 27 27 if err != nil { 28 28 if errors.Is(err, gorm.ErrRecordNotFound) { ··· 40 40 return nil, fmt.Errorf("account was taken down") 41 41 } 42 42 43 - reqCid := cid.Undef 44 - if commit != "" { 45 - reqCid, err = cid.Decode(commit) 46 - if err != nil { 47 - log.Errorw("failed to decode commit cid", "err", err, "cid", commit) 48 - return nil, echo.NewHTTPError(http.StatusBadRequest, "failed to decode commit cid") 49 - } 50 - } 51 - 52 - _, record, err := s.repoman.GetRecord(ctx, u.ID, collection, rkey, reqCid) 43 + _, record, err := s.repoman.GetRecord(ctx, u.ID, collection, rkey, cid.Undef) 53 44 if err != nil { 54 45 if errors.Is(err, mst.ErrNotFound) { 55 46 return nil, echo.NewHTTPError(http.StatusNotFound, "record not found in repo")
+1 -9
bgs/stubs.go
··· 112 112 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoSyncGetRecord") 113 113 defer span.End() 114 114 collection := c.QueryParam("collection") 115 - commit := c.QueryParam("commit") 116 115 did := c.QueryParam("did") 117 116 rkey := c.QueryParam("rkey") 118 117 ··· 131 130 return c.JSON(http.StatusBadRequest, XRPCError{Message: fmt.Sprintf("invalid did: %s", did)}) 132 131 } 133 132 134 - if commit != "" { 135 - _, err = cid.Parse(commit) 136 - if err != nil { 137 - return c.JSON(http.StatusBadRequest, XRPCError{Message: fmt.Sprintf("invalid commit: %s", commit)}) 138 - } 139 - } 140 - 141 133 var out io.Reader 142 134 var handleErr error 143 135 // func (s *BGS) handleComAtprotoSyncGetRecord(ctx context.Context,collection string,commit string,did string,rkey string) (io.Reader, error) 144 - out, handleErr = s.handleComAtprotoSyncGetRecord(ctx, collection, commit, did, rkey) 136 + out, handleErr = s.handleComAtprotoSyncGetRecord(ctx, collection, did, rkey) 145 137 if handleErr != nil { 146 138 return handleErr 147 139 }