forked from hailey.at/cocoon
An atproto PDS written in Go

cid deletion fix (#2)

authored by juli.ee and committed by GitHub df62dc92 3bd88c92

Changed files
+4 -1
server
+4 -1
server/repo.go
··· 209 ops := make([]*atproto.SyncSubscribeRepos_RepoOp, 0, len(diffops)) 210 211 for _, op := range diffops { 212 switch op.Op { 213 case "add", "mut": 214 kind := "create" ··· 216 kind = "update" 217 } 218 219 ll := lexutil.LexLink(op.NewCid) 220 ops = append(ops, &atproto.SyncSubscribeRepos_RepoOp{ 221 Action: kind, ··· 224 }) 225 226 case "del": 227 ll := lexutil.LexLink(op.OldCid) 228 ops = append(ops, &atproto.SyncSubscribeRepos_RepoOp{ 229 Action: "delete", ··· 233 }) 234 } 235 236 - blk, err := dbs.Get(context.TODO(), op.NewCid) 237 if err != nil { 238 return nil, err 239 }
··· 209 ops := make([]*atproto.SyncSubscribeRepos_RepoOp, 0, len(diffops)) 210 211 for _, op := range diffops { 212 + var c cid.Cid 213 switch op.Op { 214 case "add", "mut": 215 kind := "create" ··· 217 kind = "update" 218 } 219 220 + c = op.NewCid 221 ll := lexutil.LexLink(op.NewCid) 222 ops = append(ops, &atproto.SyncSubscribeRepos_RepoOp{ 223 Action: kind, ··· 226 }) 227 228 case "del": 229 + c = op.OldCid 230 ll := lexutil.LexLink(op.OldCid) 231 ops = append(ops, &atproto.SyncSubscribeRepos_RepoOp{ 232 Action: "delete", ··· 236 }) 237 } 238 239 + blk, err := dbs.Get(context.TODO(), c) 240 if err != nil { 241 return nil, err 242 }