Diagnostics for atproto PDS hosts, DIDs, and handles: https://debug.hose.cam

repo state

Changed files
+167 -11
+167 -11
index.html
··· 38 38 window.slingshot = window.SimpleQuery('https://slingshot.microcosm.blue'); 39 39 window.relays = [ 40 40 { 41 - name: 'Bluesky production', 42 - hostname: 'bsky.network', 43 - }, 44 - { 45 41 name: 'Bluesky sync1.1 East', 46 42 hostname: 'relay1.us-east.bsky.network', 47 43 }, ··· 50 46 hostname: 'relay1.us-west.bsky.network', 51 47 }, 52 48 { 53 - name: 'Blacksky', 54 - hostname: 'atproto.africa', 55 - }, 56 - { 57 49 name: 'Microcosm Montreal', 58 50 hostname: 'relay.fire.hose.cam', 59 51 }, 60 52 { 61 53 name: 'Microcosm France', 62 54 hostname: 'relay3.fr.hose.cam', 55 + }, 56 + { 57 + name: 'Bluesky prod (old)', 58 + hostname: 'bsky.network', 59 + }, 60 + { 61 + name: 'Blacksky (partial xrpc)', 62 + hostname: 'atproto.africa', 63 + }, 64 + { 65 + name: 'Upcloud (no CORS)', 66 + hostname: 'relay.upcloud.world', 63 67 }, 64 68 ]; 65 69 </script> ··· 319 323 } 320 324 loading = false; 321 325 } 322 - })) 326 + })); 327 + 328 + Alpine.data('didRepoState', (did, pds) => ({ 329 + loading: false, 330 + error: null, 331 + state: null, 332 + 333 + async init() { 334 + await this.checkRepoState(did, pds); 335 + }, 336 + async checkRepoState(did, pds) { 337 + this.loading = true; 338 + this.error = null; 339 + this.state = null; 340 + 341 + if (!did || !pds) { 342 + this.loading = false; 343 + return; 344 + } 345 + const query = window.SimpleQuery(pds); 346 + try { 347 + this.state = await query('com.atproto.sync.getRepoStatus', { 348 + params: { did }, 349 + }); 350 + } catch (e) { 351 + if (window.isXrpcErr(e)) { 352 + this.error = e.error; 353 + } else { 354 + this.error = 'failed (see console)'; 355 + console.error(e); 356 + } 357 + } 358 + this.loading = false; 359 + }, 360 + })); 361 + 362 + Alpine.data('relayCheckRepo', (did, relay) => ({ 363 + loading: false, 364 + error: null, 365 + status: null, 366 + 367 + async init() { 368 + await this.check(did, relay); 369 + }, 370 + 371 + async check(did, relay) { 372 + this.loading = true; 373 + this.error = null; 374 + this.status = null; 375 + 376 + const query = window.SimpleQuery(`https://${relay.hostname}`); 377 + try { 378 + this.status = await query('com.atproto.sync.getRepoStatus', { 379 + params: { did }, 380 + }); 381 + } catch(e) { 382 + if (window.isXrpcErr(e)) { 383 + this.error = e.error; 384 + } else { 385 + this.error = 'Failed to check (see console)'; 386 + console.error(e); 387 + } 388 + } 389 + 390 + this.loading = false; 391 + }, 392 + })); 323 393 }) 324 394 </script> 325 395 </head> ··· 475 545 </div> 476 546 477 547 <h3 class="text-lg">Relay host status</h3> 478 - <div class="overflow-x-auto"> 548 + <div class="overflow-x-auto overflow-y-auto max-h-33"> 479 549 <table class="table table-xs"> 480 550 <tbody> 481 551 <template x-for="relay in window.relays"> ··· 542 612 <span class="badge badge-secondary">DID</span> 543 613 <code x-text="did"></code> 544 614 </h2> 545 - <p>(wip)</p> 615 + <template x-if="pds != null"> 616 + <div x-data="didRepoState(did, pds)"> 617 + <h3 class="text-lg"> 618 + Repo 619 + <span 620 + x-show="state && state.active" 621 + class="badge badge-sm badge-soft badge-success" 622 + >active</span> 623 + </h3> 624 + <div class="overflow-x-auto"> 625 + <table class="table table-xs"> 626 + <tbody> 627 + <tr> 628 + <td class="text-sm"> 629 + Rev: 630 + <code x-text="state && state.rev"></code> 631 + </td> 632 + </tr> 633 + <tr> 634 + <td class="text-sm"> 635 + PDS: 636 + <a 637 + href="#" 638 + class="link" 639 + @click.prevent="goto(pds)" 640 + x-text="pds" 641 + ></a> 642 + </td> 643 + </tr> 644 + </tbody> 645 + </table> 646 + </div> 647 + 648 + <h3 class="text-lg"> 649 + Relay repo status 650 + </h3> 651 + <div class="overflow-x-auto overflow-y-auto max-h-33"> 652 + <table class="table table-xs"> 653 + <tbody> 654 + <template x-for="relay in window.relays"> 655 + <tr 656 + x-data="relayCheckRepo(did, relay)" 657 + x-init="$watch('pds', pds => check(did, relay))" 658 + > 659 + <td x-text="relay.name" class="text-sm"></td> 660 + <template x-if="loading"> 661 + <td> 662 + <em>loading&hellip;</em> 663 + </td> 664 + </template> 665 + <template x-if="error"> 666 + <td 667 + x-text="error" 668 + class="text-xs text-warning" 669 + ></td> 670 + </template> 671 + <template x-if="status"> 672 + <td> 673 + <span 674 + x-show="status.active" 675 + class="badge badge-sm badge-soft badge-success" 676 + > 677 + active 678 + </span> 679 + <span 680 + x-show="!status.active" 681 + x-text="status.status" 682 + class="badge badge-sm badge-soft badge-warning" 683 + ></span> 684 + </td> 685 + </template> 686 + <template x-if="status"> 687 + <td> 688 + <code 689 + x-text="status.rev" 690 + class="badge badge-sm badge-soft" 691 + :class="status && state && (status.rev >= state.rev) ? 'badge-success' : 'badge-warning'" 692 + ></code> 693 + </td> 694 + </template> 695 + </tr> 696 + </template> 697 + </tbody> 698 + </table> 699 + </div> 700 + </div> 701 + </template> 546 702 </div> 547 703 </div> 548 704 </template>