···359 repoMap[string(repos[i].RepoAt())] = &repos[i]
360 }
361362- for issueAt := range issueMap {
363- i := issueMap[issueAt]
364- r := repoMap[string(i.RepoAt)]
365- i.Repo = r
0000366 }
367368 // collect comments
···359 repoMap[string(repos[i].RepoAt())] = &repos[i]
360 }
361362+ for issueAt, i := range issueMap {
363+ if r, ok := repoMap[string(i.RepoAt)]; ok {
364+ i.Repo = r
365+ } else {
366+ // do not show up the issue if the repo is deleted
367+ // TODO: foreign key where?
368+ delete(issueMap, issueAt)
369+ }
370 }
371372 // collect comments
+2-2
appview/db/profile.go
···553 query = `select count(id) from pulls where owner_did = ? and state = ?`
554 args = append(args, did, PullOpen)
555 case VanityStatOpenIssueCount:
556- query = `select count(id) from issues where owner_did = ? and open = 1`
557 args = append(args, did)
558 case VanityStatClosedIssueCount:
559- query = `select count(id) from issues where owner_did = ? and open = 0`
560 args = append(args, did)
561 case VanityStatRepositoryCount:
562 query = `select count(id) from repos where did = ?`
···553 query = `select count(id) from pulls where owner_did = ? and state = ?`
554 args = append(args, did, PullOpen)
555 case VanityStatOpenIssueCount:
556+ query = `select count(id) from issues where did = ? and open = 1`
557 args = append(args, did)
558 case VanityStatClosedIssueCount:
559+ query = `select count(id) from issues where did = ? and open = 0`
560 args = append(args, did)
561 case VanityStatRepositoryCount:
562 query = `select count(id) from repos where did = ?`
···30 <div class="mx-6">
31 These services may not be fully accessible until upgraded.
32 <a class="underline text-red-800 dark:text-red-200"
33- href="https://tangled.sh/@tangled.sh/core/tree/master/docs/migrations/">
34 Click to read the upgrade guide</a>.
35 </div>
36 </details>
···30 <div class="mx-6">
31 These services may not be fully accessible until upgraded.
32 <a class="underline text-red-800 dark:text-red-200"
33+ href="https://tangled.sh/@tangled.sh/core/tree/master/docs/migrations.md">
34 Click to read the upgrade guide</a>.
35 </div>
36 </details>
···1-# Upgrading from v1.7.0
2-3-After v1.7.0, knot secrets have been deprecated. You no
4-longer need a secret from the appview to run a knot. All
5-authorized commands to knots are managed via [Inter-Service
6-Authentication](https://atproto.com/specs/xrpc#inter-service-authentication-jwt).
7-Knots will be read-only until upgraded.
8-9-Upgrading is quite easy, in essence:
10-11-- `KNOT_SERVER_SECRET` is no more, you can remove this
12- environment variable entirely
13-- `KNOT_SERVER_OWNER` is now required on boot, set this to
14- your DID. You can find your DID in the
15- [settings](https://tangled.sh/settings) page.
16-- Restart your knot once you have replaced the environment
17- variable
18-- Head to the [knot dashboard](https://tangled.sh/knots) and
19- hit the "retry" button to verify your knot. This simply
20- writes a `sh.tangled.knot` record to your PDS.
21-22-## Nix
23-24-If you use the nix module, simply bump the flake to the
25-latest revision, and change your config block like so:
26-27-```diff
28- services.tangled-knot = {
29- enable = true;
30- server = {
31-- secretFile = /path/to/secret;
32-+ owner = "did:plc:foo";
33- };
34- };
35-```
···1+# Migrations
2+3+This document is laid out in reverse-chronological order.
4+Newer migration guides are listed first, and older guides
5+are further down the page.
6+7+## Upgrading from v1.8.x
8+9+After v1.8.2, the HTTP API for knot and spindles have been
10+deprecated and replaced with XRPC. Repositories on outdated
11+knots will not be viewable from the appview. Upgrading is
12+straightforward however.
13+14+For knots:
15+16+- Upgrade to latest tag (v1.9.0 or above)
17+- Head to the [knot dashboard](https://tangled.sh/knots) and
18+ hit the "retry" button to verify your knot
19+20+For spindles:
21+22+- Upgrade to latest tag (v1.9.0 or above)
23+- Head to the [spindle
24+ dashboard](https://tangled.sh/spindles) and hit the
25+ "retry" button to verify your spindle
26+27+## Upgrading from v1.7.x
28+29+After v1.7.0, knot secrets have been deprecated. You no
30+longer need a secret from the appview to run a knot. All
31+authorized commands to knots are managed via [Inter-Service
32+Authentication](https://atproto.com/specs/xrpc#inter-service-authentication-jwt).
33+Knots will be read-only until upgraded.
34+35+Upgrading is quite easy, in essence:
36+37+- `KNOT_SERVER_SECRET` is no more, you can remove this
38+ environment variable entirely
39+- `KNOT_SERVER_OWNER` is now required on boot, set this to
40+ your DID. You can find your DID in the
41+ [settings](https://tangled.sh/settings) page.
42+- Restart your knot once you have replaced the environment
43+ variable
44+- Head to the [knot dashboard](https://tangled.sh/knots) and
45+ hit the "retry" button to verify your knot. This simply
46+ writes a `sh.tangled.knot` record to your PDS.
47+48+If you use the nix module, simply bump the flake to the
49+latest revision, and change your config block like so:
50+51+```diff
52+ services.tangled-knot = {
53+ enable = true;
54+ server = {
55+- secretFile = /path/to/secret;
56++ owner = "did:plc:foo";
57+ };
58+ };
59+```
60+
···56 WithMessage("owner not set for this service"),
57)
58000000000059var AuthError = func(err error) XrpcError {
60 return NewXrpcError(
61 WithTag("Auth"),
···56 WithMessage("owner not set for this service"),
57)
5859+var RepoNotFoundError = NewXrpcError(
60+ WithTag("RepoNotFound"),
61+ WithMessage("failed to access repository"),
62+)
63+64+var RefNotFoundError = NewXrpcError(
65+ WithTag("RefNotFound"),
66+ WithMessage("failed to access ref"),
67+)
68+69var AuthError = func(err error) XrpcError {
70 return NewXrpcError(
71 WithTag("Auth"),