···6767 return rc.Handle, rc.Repo, nil
6868}
69697070-// findRepoDid resolves a handle to its owner DID, lists their repos,
7171-// and returns the repoDid of the matching repo. Matches by the Name
7272-// field, falling back to the rkey in the at:// URI when Name is empty.
7070+// findRepoDid resolves handle/repo to the repo's repoDid, which listIssues is
7171+// keyed by. It looks the record up directly by name (current schema uses the
7272+// name as the rkey), falling back to a listing for legacy repos whose rkey is a
7373+// TID with the name in the body.
7374func findRepoDid(ctx context.Context, handle, repo string) (string, error) {
7475 ident, err := resolver.ResolveHandle(ctx, handle)
7576 if err != nil {
7677 return "", fmt.Errorf("resolve handle %q: %w", handle, err)
7778 }
78797979- repos, err := client.ListRepos(ctx, ident.DID.String())
8080- if err != nil {
8181- return "", fmt.Errorf("list repos for %q: %w", handle, err)
8080+ repoURI := fmt.Sprintf("at://%s/sh.tangled.repo/%s", ident.DID, repo)
8181+ if got, err := client.GetRepo(ctx, repoURI); err == nil {
8282+ return got.Value.RepoDid, nil
8283 }
83848484- for _, item := range repos.Items {
8585- if item.Value.Name == repo || strings.HasSuffix(item.URI, "/"+repo) {
8686- return item.Value.RepoDid, nil
8585+ if repos, err := client.ListRepos(ctx, ident.DID.String()); err == nil {
8686+ for _, item := range repos.Items {
8787+ if item.Value.Name == repo || strings.HasSuffix(item.URI, "/"+repo) {
8888+ return item.Value.RepoDid, nil
8989+ }
8790 }
8891 }
8992