Fix profile broadcasting during signup (issue #201) #212

Closed
priyanshu_bharti wants to merge 1 commits from priyanshu_bharti/flotilla:fix/profile-broadcast-on-signup into dev
Contributor

Fix profile broadcasting during signup (issue #201)

Problem

  • Profile event (kind 0) was not published during signup (initProfile was using empty relay array [])
  • New users' profiles were not discoverable until they joined a space
  • Sometimes profile events weren't getting fetched even after providing username

Solution

  • Publish kind 0 profile event immediately during signup/onboarding
  • Use smart relay selection: user relays if available, else fallback to DEFAULT_RELAYS
  • Preserve "protected by default" behavior (PROTECTED tag)
  • Avoid duplicate profile broadcasts on space join
  • Await publishes in signup and join flows for better reliability

Changes

  • initProfile(): Now publishes profile to proper relays instead of empty array
  • SpaceJoin.svelte & SpaceInviteAccept.svelte: Await broadcast for reliability
  • SignUp.svelte: Improved flow sequencing
  • Removed unnecessary re-broadcast of PROFILE kind on space join

Testing

  • New signup now creates immediately discoverable profile
  • Profile is no longer duplicated on space join
  • PROTECTED tag behavior preserved
  • All checks passing (Prettier, ESLint, Svelte check)

Closes #201

**Fix profile broadcasting during signup (issue #201)** ### Problem - Profile event (kind 0) was not published during signup (`initProfile` was using empty relay array `[]`) - New users' profiles were not discoverable until they joined a space - Sometimes profile events weren't getting fetched even after providing username ### Solution - Publish kind 0 profile event immediately during signup/onboarding - Use smart relay selection: user relays if available, else fallback to `DEFAULT_RELAYS` - Preserve "protected by default" behavior (`PROTECTED` tag) - Avoid duplicate profile broadcasts on space join - Await publishes in signup and join flows for better reliability ### Changes - `initProfile()`: Now publishes profile to proper relays instead of empty array - `SpaceJoin.svelte` & `SpaceInviteAccept.svelte`: Await broadcast for reliability - `SignUp.svelte`: Improved flow sequencing - Removed unnecessary re-broadcast of PROFILE kind on space join ### Testing - New signup now creates immediately discoverable profile - Profile is no longer duplicated on space join - `PROTECTED` tag behavior preserved - All checks passing (Prettier, ESLint, Svelte check) Closes #201
priyanshu_bharti added 1 commit 2026-04-16 15:48:45 +00:00
- Publish kind 0 profile event immediately on signup instead of empty array
- Use user relays if available, fallback to DEFAULT_RELAYS during onboarding
- Keep existing 'protected by default' behavior with PROTECTED tag
- Remove PROFILE from space join rebroadcast to avoid duplicates
- Await user data broadcasts in space join flows for reliability
- Add clear inline comments explaining changes
Owner

This was a very opinionated change, and I hadn't made up my mind about it really. I went ahead and fixed it myself via e1a7b051bd.

This was a very opinionated change, and I hadn't made up my mind about it really. I went ahead and fixed it myself via e1a7b051bd870e2e2b3354e388208f1768bd8062.
hodlbod closed this pull request 2026-04-16 18:42:12 +00:00

Pull request closed

Sign in to join this conversation.