Skip to content

Fix discovered identity profile sync#105

Merged
LiranCohen merged 1 commit into
mainfrom
fix/discovered-identity-profile-sync
May 28, 2026
Merged

Fix discovered identity profile sync#105
LiranCohen merged 1 commit into
mainfrom
fix/discovered-identity-profile-sync

Conversation

@LiranCohen

Copy link
Copy Markdown
Contributor

Summary

  • reconcile locally discovered identities into the wallet-scoped sync protocols (social graph, profile, connect)
  • trigger a pull immediately after registering/updating discovered identity sync scope so profile/avatar/hero records written before subscription are fetched
  • subscribe to sync pull checkpoint events to invalidate identity and profile queries as remote data arrives

Root cause

#104 fixed the writer side by installing protocols before identity profile writes. The remaining failure was on the reader side: wallet 1 learned about identity 2 through agent DID sync, so the identity shell appeared in agent.identity.list(), but the already-running session never registered identity 2 for profile/social/connect sync. Since identity 2 profile records were written before wallet 1 opened those subscriptions, wallet 1 also needed a historical pull before the profile query could return display name, avatar, and banner data.

Tests

  • bun run test -- src/enbox/__tests__/identity-sync.test.ts src/enbox/hooks/__tests__/use-identity-sync-reconciliation.test.tsx src/enbox/hooks/__tests__/use-sync-query-invalidation.test.tsx
  • bunx tsc -b
  • bun run test
  • bun run lint (passes with existing Testing Library warnings)
  • bun run build (passes with existing chunk-size warnings)

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.41% (🎯 25%) 914 / 2155
🔵 Statements 40.96% (🎯 25%) 984 / 2402
🔵 Functions 42.88% (🎯 30%) 262 / 611
🔵 Branches 38.05% (🎯 29%) 591 / 1553
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/App.tsx 49.36% 28.2% 52.17% 48% 42-78, 101-103, 133-137, 144, 160, 171, 176-189, 206-214, 216-259
src/enbox/identity-sync.ts 71.18% 60.46% 63.63% 72.41% 24-32, 47, 60, 67-74, 82, 96, 108-115, 132
src/enbox/hooks/use-identity-sync-reconciliation.ts 87.5% 86.66% 100% 86.66% 34-35, 44, 63
src/enbox/hooks/use-sync-query-invalidation.ts 88.23% 83.33% 100% 87.87% 40, 47, 64-65
Generated in workflow #276 for commit c95e5b3 by the Vitest Coverage Report Action

@LiranCohen LiranCohen merged commit 666e937 into main May 28, 2026
4 checks passed
@LiranCohen LiranCohen deleted the fix/discovered-identity-profile-sync branch May 28, 2026 18:07
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