Skip to content

fix(registration): scope tenant setup to topology changes - #182

Merged
LiranCohen merged 1 commit into
mainfrom
fix/registration-lifecycle
Jul 20, 2026
Merged

fix(registration): scope tenant setup to topology changes#182
LiranCohen merged 1 commit into
mainfrom
fix/registration-lifecycle

Conversation

@LiranCohen

Copy link
Copy Markdown
Contributor

Summary

  • stop remote tenant registration during unlock, auto-restore, identity import, sync discovery, and connect approval
  • register a DID only at normalized endpoints newly added by an explicit topology edit; require every addition to succeed before publishing the endpoint list
  • repair only exact server-confirmed 401 states for a missing tenant or stale terms, while ignoring suspension, generic authorization, and transport failures
  • coalesce duplicate repairs and serialize different-endpoint repairs for the same DID before rebuilding its existing live-sync scope

Why

Repeated registration is both noisy and account-affecting under provider auth. Existing tenant ownership should be preserved unless the user adds a DWN, or that DWN explicitly reports that the tenant registration is missing or has stale terms.

Test plan

  • Focused Vitest slice: 104 tests across registration, identity lifecycle, sync discovery, auth restore, and connect approval
  • Changed-file ESLint
  • TypeScript no-emit check
  • Production build

Rollout

No migration is required. Existing identities keep their current remote registrations and encrypted provider-auth tokens.

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 69.43% (🎯 25%) 3537 / 5094
🟢 Statements 67.41% (🎯 25%) 3738 / 5545
🟢 Functions 65.85% (🎯 30%) 1076 / 1634
🟢 Branches 63.39% (🎯 29%) 2343 / 3696
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/App.tsx 65.21% 52% 62.5% 64.88% 70-83, 100-101, 108, 153-155, 190-195, 202-203, 209-216, 246-255, 261, 293-308, 320, 326-339, 361
src/enbox/identity-sync.ts 90.56% 78.12% 90.9% 90.56% 54, 102-106, 145
src/enbox/provider.tsx 79.02% 48% 72.22% 82.25% 66, 79, 122, 172, 180-181, 192, 197, 214-225, 231, 235, 246, 256, 299, 308, 322-327, 341, 364-369, 378-393, 402, 407-408
src/enbox/registration-repair.ts 94.11% 92.85% 87.5% 96.96% 29, 78
src/enbox/registration.ts 69.23% 58.97% 59.37% 70.45% 32, 37-102, 126, 136-140, 187, 201, 215-219, 234-240, 252
src/enbox/hooks/use-registration-repair.ts 90% 100% 80% 88.88% 26-29
src/enbox/mutations/identity-mutations.ts 74.48% 61.97% 71.59% 74.35% 59, 66, 88, 93, 98, 132-133, 150-160, 344-345, 393-398, 427-433, 441-450, 471-517, 591-596, 619-624, 634
src/features/connect/AppConnectPage.tsx 60.78% 66.66% 56.36% 62.31% 238-239, 261-262, 271-272, 288, 294-321, 328-375, 421, 427, 433, 488-490, 509, 517, 529, 535-536, 545-551, 558-578, 598-614, 625-628, 650-867, 879-928
src/features/connect/DWebConnectPage.tsx 67.25% 67.22% 58.13% 67.61% 228, 229, 236, 243, 301, 307, 333-427, 433-434, 443, 454, 479-482, 541-649, 661-699
Generated in workflow #427 for commit 54a0608 by the Vitest Coverage Report Action

@LiranCohen
LiranCohen merged commit cb714f2 into main Jul 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant