diff --git a/appview/db/repos.go b/appview/db/repos.go --- a/appview/db/repos.go +++ b/appview/db/repos.go @@ -373,13 +373,6 @@ // get forks forksInClause := strings.TrimSuffix(strings.Repeat("?, ", len(repoMap)), ", ") forkArgs := make([]any, len(repoMap)) - repoDidMap := make(map[string]syntax.ATURI) - i = 0 - for aturi, r := range repoMap { - forkArgs[i] = r.RepoDid - repoDidMap[r.RepoDid] = aturi - i++ - } forksCountQuery := fmt.Sprintf( `select source, count(1) from repos where source in (%s) group by source`, @@ -400,12 +393,7 @@ continue } - atURI, ok := repoDidMap[repodid] - if !ok { - continue - } - - if r, ok := repoMap[atURI]; ok { + if r, ok := repoMap[repodid]; ok { r.RepoStats.ForkCount = count } } diff --git a/appview/db/vouch.go b/appview/db/vouch.go --- a/appview/db/vouch.go +++ b/appview/db/vouch.go @@ -373,7 +373,7 @@ select p.owner_did as did, 3 as priority, p.created, 'This user opened a pull request on your repository' as reason from pulls p - join repos r on r.at_uri = p.repo_at + join repos r on r.repo_did = p.repo_did where r.did = ? and p.owner_did != ? @@ -382,7 +382,7 @@ select i.did as did, 4 as priority, i.created, 'This user opened an issue on your repository' as reason from issues i - join repos r on r.at_uri = i.repo_at + join repos r on r.repo_did = i.repo_did where r.did = ? and i.did != ? @@ -391,7 +391,7 @@ select pc.owner_did as did, 5 as priority, pc.created, 'This user commented on a pull request on your repository' as reason from pull_comments pc - join repos r on r.at_uri = pc.repo_at + join repos r on r.repo_did = pc.repo_did where r.did = ? and pc.owner_did != ? @@ -401,7 +401,7 @@ 'This user commented on an issue on your repository' as reason from issue_comments ic join issues i on i.at_uri = ic.issue_at - join repos r on r.at_uri = i.repo_at + join repos r on r.repo_did = i.repo_did where r.did = ? and ic.did != ? @@ -418,7 +418,7 @@ select r.did as did, 8 as priority, s.created, 'You recently starred a repository by this user' as reason from stars s - join repos r on r.at_uri = s.subject_at + join repos r on r.at_uri = s.subject where s.did = ? and r.did != ? )