https://github.com/bluesky-social/goat but with tangled's CI
10
fork

Configure Feed

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

use syntax.ParseRepoPath when appropriate (#889)

This helper was added recently. Rip out old copy-pasta versions and
start actually using it.

authored by

bnewbold and committed by
GitHub
711bff7a 8aa5a426

+1 -18
+1 -18
firehose.go
··· 133 133 return events.HandleRepoStream(ctx, con, scheduler, nil) 134 134 } 135 135 136 - // TODO: move this to a "ParsePath" helper in syntax package? 137 - func splitRepoPath(path string) (syntax.NSID, syntax.RecordKey, error) { 138 - parts := strings.SplitN(path, "/", 3) 139 - if len(parts) != 2 { 140 - return "", "", fmt.Errorf("invalid record path: %s", path) 141 - } 142 - collection, err := syntax.ParseNSID(parts[0]) 143 - if err != nil { 144 - return "", "", err 145 - } 146 - rkey, err := syntax.ParseRecordKey(parts[1]) 147 - if err != nil { 148 - return "", "", err 149 - } 150 - return collection, rkey, nil 151 - } 152 - 153 136 func (gfc *GoatFirehoseConsumer) handleIdentityEvent(ctx context.Context, evt *comatproto.SyncSubscribeRepos_Identity) error { 154 137 out := make(map[string]interface{}) 155 138 out["type"] = "identity" ··· 229 212 } 230 213 231 214 for _, op := range evt.Ops { 232 - collection, rkey, err := splitRepoPath(op.Path) 215 + collection, rkey, err := syntax.ParseRepoPath(op.Path) 233 216 if err != nil { 234 217 logger.Error("invalid path in repo op", "eventKind", op.Action, "path", op.Path) 235 218 return nil