Bluesky app fork with some witchin' additions 💫

Add `isSelfHosted` to `SessionAccount` (#7028)

* Add isSelfHosted to SessionAccount

* Update snaps

authored by Eric Bailey and committed by GitHub bc4b4a3c 63c0c7e6

Changed files
+34
src
state
persisted
session
+1
src/state/persisted/schema.ts
··· 28 28 */ 29 29 status: z.string().optional(), 30 30 pdsUrl: z.string().optional(), 31 + isSelfHosted: z.boolean().optional(), 31 32 }) 32 33 export type PersistedAccount = z.infer<typeof accountSchema> 33 34
+31
src/state/session/__tests__/session-test.ts
··· 61 61 "emailAuthFactor": false, 62 62 "emailConfirmed": false, 63 63 "handle": "alice.test", 64 + "isSelfHosted": true, 64 65 "pdsUrl": undefined, 65 66 "refreshJwt": "alice-refresh-jwt-1", 66 67 "service": "https://alice.com/", ··· 100 101 "emailAuthFactor": false, 101 102 "emailConfirmed": false, 102 103 "handle": "alice.test", 104 + "isSelfHosted": true, 103 105 "pdsUrl": undefined, 104 106 "refreshJwt": undefined, 105 107 "service": "https://alice.com/", ··· 152 154 "emailAuthFactor": false, 153 155 "emailConfirmed": false, 154 156 "handle": "alice.test", 157 + "isSelfHosted": true, 155 158 "pdsUrl": undefined, 156 159 "refreshJwt": "alice-refresh-jwt-1", 157 160 "service": "https://alice.com/", ··· 202 205 "emailAuthFactor": false, 203 206 "emailConfirmed": false, 204 207 "handle": "bob.test", 208 + "isSelfHosted": true, 205 209 "pdsUrl": undefined, 206 210 "refreshJwt": "bob-refresh-jwt-1", 207 211 "service": "https://bob.com/", ··· 216 220 "emailAuthFactor": false, 217 221 "emailConfirmed": false, 218 222 "handle": "alice.test", 223 + "isSelfHosted": true, 219 224 "pdsUrl": undefined, 220 225 "refreshJwt": "alice-refresh-jwt-1", 221 226 "service": "https://alice.com/", ··· 266 271 "emailAuthFactor": false, 267 272 "emailConfirmed": false, 268 273 "handle": "alice-updated.test", 274 + "isSelfHosted": true, 269 275 "pdsUrl": undefined, 270 276 "refreshJwt": "alice-refresh-jwt-2", 271 277 "service": "https://alice.com/", ··· 280 286 "emailAuthFactor": false, 281 287 "emailConfirmed": false, 282 288 "handle": "bob.test", 289 + "isSelfHosted": true, 283 290 "pdsUrl": undefined, 284 291 "refreshJwt": "bob-refresh-jwt-1", 285 292 "service": "https://bob.com/", ··· 328 335 "emailAuthFactor": false, 329 336 "emailConfirmed": false, 330 337 "handle": "jay.test", 338 + "isSelfHosted": true, 331 339 "pdsUrl": undefined, 332 340 "refreshJwt": "jay-refresh-jwt-1", 333 341 "service": "https://jay.com/", ··· 342 350 "emailAuthFactor": false, 343 351 "emailConfirmed": false, 344 352 "handle": "alice-updated.test", 353 + "isSelfHosted": true, 345 354 "pdsUrl": undefined, 346 355 "refreshJwt": "alice-refresh-jwt-2", 347 356 "service": "https://alice.com/", ··· 356 365 "emailAuthFactor": false, 357 366 "emailConfirmed": false, 358 367 "handle": "bob.test", 368 + "isSelfHosted": true, 359 369 "pdsUrl": undefined, 360 370 "refreshJwt": "bob-refresh-jwt-1", 361 371 "service": "https://bob.com/", ··· 399 409 "emailAuthFactor": false, 400 410 "emailConfirmed": false, 401 411 "handle": "jay.test", 412 + "isSelfHosted": true, 402 413 "pdsUrl": undefined, 403 414 "refreshJwt": undefined, 404 415 "service": "https://jay.com/", ··· 413 424 "emailAuthFactor": false, 414 425 "emailConfirmed": false, 415 426 "handle": "alice-updated.test", 427 + "isSelfHosted": true, 416 428 "pdsUrl": undefined, 417 429 "refreshJwt": undefined, 418 430 "service": "https://alice.com/", ··· 427 439 "emailAuthFactor": false, 428 440 "emailConfirmed": false, 429 441 "handle": "bob.test", 442 + "isSelfHosted": true, 430 443 "pdsUrl": undefined, 431 444 "refreshJwt": undefined, 432 445 "service": "https://bob.com/", ··· 488 501 "emailAuthFactor": false, 489 502 "emailConfirmed": false, 490 503 "handle": "alice.test", 504 + "isSelfHosted": true, 491 505 "pdsUrl": undefined, 492 506 "refreshJwt": undefined, 493 507 "service": "https://alice.com/", ··· 535 549 "emailAuthFactor": false, 536 550 "emailConfirmed": false, 537 551 "handle": "alice.test", 552 + "isSelfHosted": true, 538 553 "pdsUrl": undefined, 539 554 "refreshJwt": "alice-refresh-jwt-2", 540 555 "service": "https://alice.com/", ··· 651 666 "emailAuthFactor": false, 652 667 "emailConfirmed": false, 653 668 "handle": "bob.test", 669 + "isSelfHosted": true, 654 670 "pdsUrl": undefined, 655 671 "refreshJwt": "bob-refresh-jwt-1", 656 672 "service": "https://bob.com/", ··· 743 759 "emailAuthFactor": false, 744 760 "emailConfirmed": false, 745 761 "handle": "bob.test", 762 + "isSelfHosted": true, 746 763 "pdsUrl": undefined, 747 764 "refreshJwt": undefined, 748 765 "service": "https://bob.com/", ··· 757 774 "emailAuthFactor": false, 758 775 "emailConfirmed": false, 759 776 "handle": "alice.test", 777 + "isSelfHosted": true, 760 778 "pdsUrl": undefined, 761 779 "refreshJwt": "alice-refresh-jwt-1", 762 780 "service": "https://alice.com/", ··· 832 850 "emailAuthFactor": false, 833 851 "emailConfirmed": false, 834 852 "handle": "alice-updated.test", 853 + "isSelfHosted": true, 835 854 "pdsUrl": undefined, 836 855 "refreshJwt": "alice-refresh-jwt-2", 837 856 "service": "https://alice.com/", ··· 885 904 "emailAuthFactor": true, 886 905 "emailConfirmed": true, 887 906 "handle": "alice-updated.test", 907 + "isSelfHosted": true, 888 908 "pdsUrl": undefined, 889 909 "refreshJwt": "alice-refresh-jwt-3", 890 910 "service": "https://alice.com/", ··· 938 958 "emailAuthFactor": false, 939 959 "emailConfirmed": false, 940 960 "handle": "alice-updated.test", 961 + "isSelfHosted": true, 941 962 "pdsUrl": undefined, 942 963 "refreshJwt": "alice-refresh-jwt-4", 943 964 "service": "https://alice.com/", ··· 1102 1123 "emailAuthFactor": false, 1103 1124 "emailConfirmed": false, 1104 1125 "handle": "bob.test", 1126 + "isSelfHosted": true, 1105 1127 "pdsUrl": undefined, 1106 1128 "refreshJwt": "bob-refresh-jwt-1", 1107 1129 "service": "https://bob.com/", ··· 1116 1138 "emailAuthFactor": false, 1117 1139 "emailConfirmed": false, 1118 1140 "handle": "alice-updated.test", 1141 + "isSelfHosted": true, 1119 1142 "pdsUrl": undefined, 1120 1143 "refreshJwt": "alice-refresh-jwt-2", 1121 1144 "service": "https://alice.com/", ··· 1167 1190 "emailAuthFactor": false, 1168 1191 "emailConfirmed": false, 1169 1192 "handle": "bob-updated.test", 1193 + "isSelfHosted": true, 1170 1194 "pdsUrl": undefined, 1171 1195 "refreshJwt": "bob-refresh-jwt-2", 1172 1196 "service": "https://bob.com/", ··· 1181 1205 "emailAuthFactor": false, 1182 1206 "emailConfirmed": false, 1183 1207 "handle": "alice-updated.test", 1208 + "isSelfHosted": true, 1184 1209 "pdsUrl": undefined, 1185 1210 "refreshJwt": "alice-refresh-jwt-2", 1186 1211 "service": "https://alice.com/", ··· 1332 1357 "emailAuthFactor": false, 1333 1358 "emailConfirmed": false, 1334 1359 "handle": "alice.test", 1360 + "isSelfHosted": true, 1335 1361 "pdsUrl": undefined, 1336 1362 "refreshJwt": "alice-refresh-jwt-1", 1337 1363 "service": "https://alice.com/", ··· 1397 1423 "emailAuthFactor": false, 1398 1424 "emailConfirmed": false, 1399 1425 "handle": "alice.test", 1426 + "isSelfHosted": true, 1400 1427 "pdsUrl": undefined, 1401 1428 "refreshJwt": undefined, 1402 1429 "service": "https://alice.com/", ··· 1462 1489 "emailAuthFactor": false, 1463 1490 "emailConfirmed": false, 1464 1491 "handle": "alice.test", 1492 + "isSelfHosted": true, 1465 1493 "pdsUrl": undefined, 1466 1494 "refreshJwt": undefined, 1467 1495 "service": "https://alice.com/", ··· 1559 1587 "emailAuthFactor": false, 1560 1588 "emailConfirmed": false, 1561 1589 "handle": "jay.test", 1590 + "isSelfHosted": true, 1562 1591 "pdsUrl": undefined, 1563 1592 "refreshJwt": "jay-refresh-jwt-1", 1564 1593 "service": "https://jay.com/", ··· 1573 1602 "emailAuthFactor": false, 1574 1603 "emailConfirmed": false, 1575 1604 "handle": "bob.test", 1605 + "isSelfHosted": true, 1576 1606 "pdsUrl": undefined, 1577 1607 "refreshJwt": "bob-refresh-jwt-2", 1578 1608 "service": "https://alice.com/", ··· 1622 1652 "emailAuthFactor": false, 1623 1653 "emailConfirmed": false, 1624 1654 "handle": "clarence.test", 1655 + "isSelfHosted": true, 1625 1656 "pdsUrl": undefined, 1626 1657 "refreshJwt": "clarence-refresh-jwt-2", 1627 1658 "service": "https://clarence.com/",
+2
src/state/session/agent.ts
··· 3 3 4 4 import {networkRetry} from '#/lib/async/retry' 5 5 import { 6 + BSKY_SERVICE, 6 7 DISCOVER_SAVED_FEED, 7 8 IS_PROD_SERVICE, 8 9 PUBLIC_BSKY_SERVICE, ··· 204 205 active: agent.session.active, 205 206 status: agent.session.status as SessionAccount['status'], 206 207 pdsUrl: agent.pdsUrl?.toString(), 208 + isSelfHosted: !agent.serviceUrl.toString().startsWith(BSKY_SERVICE), 207 209 } 208 210 } 209 211