···359359 repoMap[string(repos[i].RepoAt())] = &repos[i]
360360 }
361361362362- for issueAt := range issueMap {
363363- i := issueMap[issueAt]
364364- r := repoMap[string(i.RepoAt)]
365365- i.Repo = r
362362+ for issueAt, i := range issueMap {
363363+ if r, ok := repoMap[string(i.RepoAt)]; ok {
364364+ i.Repo = r
365365+ } else {
366366+ // do not show up the issue if the repo is deleted
367367+ // TODO: foreign key where?
368368+ delete(issueMap, issueAt)
369369+ }
366370 }
367371368372 // collect comments
+2-2
appview/db/profile.go
···553553 query = `select count(id) from pulls where owner_did = ? and state = ?`
554554 args = append(args, did, PullOpen)
555555 case VanityStatOpenIssueCount:
556556- query = `select count(id) from issues where owner_did = ? and open = 1`
556556+ query = `select count(id) from issues where did = ? and open = 1`
557557 args = append(args, did)
558558 case VanityStatClosedIssueCount:
559559- query = `select count(id) from issues where owner_did = ? and open = 0`
559559+ query = `select count(id) from issues where did = ? and open = 0`
560560 args = append(args, did)
561561 case VanityStatRepositoryCount:
562562 query = `select count(id) from repos where did = ?`
···3030 <div class="mx-6">
3131 These services may not be fully accessible until upgraded.
3232 <a class="underline text-red-800 dark:text-red-200"
3333- href="https://tangled.sh/@tangled.sh/core/tree/master/docs/migrations/">
3333+ href="https://tangled.sh/@tangled.sh/core/tree/master/docs/migrations.md">
3434 Click to read the upgrade guide</a>.
3535 </div>
3636 </details>
···11-# Upgrading from v1.7.0
22-33-After v1.7.0, knot secrets have been deprecated. You no
44-longer need a secret from the appview to run a knot. All
55-authorized commands to knots are managed via [Inter-Service
66-Authentication](https://atproto.com/specs/xrpc#inter-service-authentication-jwt).
77-Knots will be read-only until upgraded.
88-99-Upgrading is quite easy, in essence:
1010-1111-- `KNOT_SERVER_SECRET` is no more, you can remove this
1212- environment variable entirely
1313-- `KNOT_SERVER_OWNER` is now required on boot, set this to
1414- your DID. You can find your DID in the
1515- [settings](https://tangled.sh/settings) page.
1616-- Restart your knot once you have replaced the environment
1717- variable
1818-- Head to the [knot dashboard](https://tangled.sh/knots) and
1919- hit the "retry" button to verify your knot. This simply
2020- writes a `sh.tangled.knot` record to your PDS.
2121-2222-## Nix
2323-2424-If you use the nix module, simply bump the flake to the
2525-latest revision, and change your config block like so:
2626-2727-```diff
2828- services.tangled-knot = {
2929- enable = true;
3030- server = {
3131-- secretFile = /path/to/secret;
3232-+ owner = "did:plc:foo";
3333- };
3434- };
3535-```
+60
docs/migrations.md
···11+# Migrations
22+33+This document is laid out in reverse-chronological order.
44+Newer migration guides are listed first, and older guides
55+are further down the page.
66+77+## Upgrading from v1.8.x
88+99+After v1.8.2, the HTTP API for knot and spindles have been
1010+deprecated and replaced with XRPC. Repositories on outdated
1111+knots will not be viewable from the appview. Upgrading is
1212+straightforward however.
1313+1414+For knots:
1515+1616+- Upgrade to latest tag (v1.9.0 or above)
1717+- Head to the [knot dashboard](https://tangled.sh/knots) and
1818+ hit the "retry" button to verify your knot
1919+2020+For spindles:
2121+2222+- Upgrade to latest tag (v1.9.0 or above)
2323+- Head to the [spindle
2424+ dashboard](https://tangled.sh/spindles) and hit the
2525+ "retry" button to verify your spindle
2626+2727+## Upgrading from v1.7.x
2828+2929+After v1.7.0, knot secrets have been deprecated. You no
3030+longer need a secret from the appview to run a knot. All
3131+authorized commands to knots are managed via [Inter-Service
3232+Authentication](https://atproto.com/specs/xrpc#inter-service-authentication-jwt).
3333+Knots will be read-only until upgraded.
3434+3535+Upgrading is quite easy, in essence:
3636+3737+- `KNOT_SERVER_SECRET` is no more, you can remove this
3838+ environment variable entirely
3939+- `KNOT_SERVER_OWNER` is now required on boot, set this to
4040+ your DID. You can find your DID in the
4141+ [settings](https://tangled.sh/settings) page.
4242+- Restart your knot once you have replaced the environment
4343+ variable
4444+- Head to the [knot dashboard](https://tangled.sh/knots) and
4545+ hit the "retry" button to verify your knot. This simply
4646+ writes a `sh.tangled.knot` record to your PDS.
4747+4848+If you use the nix module, simply bump the flake to the
4949+latest revision, and change your config block like so:
5050+5151+```diff
5252+ services.tangled-knot = {
5353+ enable = true;
5454+ server = {
5555+- secretFile = /path/to/secret;
5656++ owner = "did:plc:foo";
5757+ };
5858+ };
5959+```
6060+