Monorepo for Tangled tangled.org
6

Configure Feed

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

appview/db: fix vouch suggestions

queries were broken after total migration to repo-dids, we no longer use
repo_at in some tables.

Signed-off-by: oppiliappan <me@oppi.li>

author
oppiliappan
date (May 11, 2026, 3:08 PM +0100) commit 50bccca6 parent 1fdd9061 change-id oxzovmwr
+6 -18
+1 -13
appview/db/repos.go
··· 373 373 // get forks 374 374 forksInClause := strings.TrimSuffix(strings.Repeat("?, ", len(repoMap)), ", ") 375 375 forkArgs := make([]any, len(repoMap)) 376 - repoDidMap := make(map[string]syntax.ATURI) 377 - i = 0 378 - for aturi, r := range repoMap { 379 - forkArgs[i] = r.RepoDid 380 - repoDidMap[r.RepoDid] = aturi 381 - i++ 382 - } 383 376 384 377 forksCountQuery := fmt.Sprintf( 385 378 `select source, count(1) from repos where source in (%s) group by source`, ··· 400 393 continue 401 394 } 402 395 403 - atURI, ok := repoDidMap[repodid] 404 - if !ok { 405 - continue 406 - } 407 - 408 - if r, ok := repoMap[atURI]; ok { 396 + if r, ok := repoMap[repodid]; ok { 409 397 r.RepoStats.ForkCount = count 410 398 } 411 399 }
+5 -5
appview/db/vouch.go
··· 373 373 select p.owner_did as did, 3 as priority, p.created, 374 374 'This user opened a pull request on your repository' as reason 375 375 from pulls p 376 - join repos r on r.at_uri = p.repo_at 376 + join repos r on r.repo_did = p.repo_did 377 377 where r.did = ? 378 378 and p.owner_did != ? 379 379 ··· 382 382 select i.did as did, 4 as priority, i.created, 383 383 'This user opened an issue on your repository' as reason 384 384 from issues i 385 - join repos r on r.at_uri = i.repo_at 385 + join repos r on r.repo_did = i.repo_did 386 386 where r.did = ? 387 387 and i.did != ? 388 388 ··· 391 391 select pc.owner_did as did, 5 as priority, pc.created, 392 392 'This user commented on a pull request on your repository' as reason 393 393 from pull_comments pc 394 - join repos r on r.at_uri = pc.repo_at 394 + join repos r on r.repo_did = pc.repo_did 395 395 where r.did = ? 396 396 and pc.owner_did != ? 397 397 ··· 401 401 'This user commented on an issue on your repository' as reason 402 402 from issue_comments ic 403 403 join issues i on i.at_uri = ic.issue_at 404 - join repos r on r.at_uri = i.repo_at 404 + join repos r on r.repo_did = i.repo_did 405 405 where r.did = ? 406 406 and ic.did != ? 407 407 ··· 418 418 select r.did as did, 8 as priority, s.created, 419 419 'You recently starred a repository by this user' as reason 420 420 from stars s 421 - join repos r on r.at_uri = s.subject_at 421 + join repos r on r.at_uri = s.subject 422 422 where s.did = ? 423 423 and r.did != ? 424 424 )