Skip to content

fix(fetch-service): parallelize NIP-05 verification in fetchProfile#353

Merged
calvadev merged 1 commit intoshopstr-eng:mainfrom
userAdityaa:fix-sequential-blocking
Apr 6, 2026
Merged

fix(fetch-service): parallelize NIP-05 verification in fetchProfile#353
calvadev merged 1 commit intoshopstr-eng:mainfrom
userAdityaa:fix-sequential-blocking

Conversation

@userAdityaa
Copy link
Copy Markdown
Contributor

Description

This PR parallelizes NIP-05 verification in fetchProfile. Previously, each call to verifyNip05Identifier was awaited inside a loop, causing serial blocking. Now, all NIP-05 checks run concurrently, so the UI is responsive and cached profiles display immediately. The early context update is restored, and NIP-05 badges still appear once verification completes. Profiles without a nip05 field are unaffected.

Before: N × 10 s (serial, each blocks the next)
After: 1 × 10 s (parallel, all run together, capped at the slowest single host)

Fixes #352

Testing

  1. Open marketplace, filter DevTools Network to nostr.json, and verify all NIP-05 requests fire simultaneously.
  2. NIP-05 badges still appear after all requests settle.
  3. Profiles without a nip05 field are unaffected.

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

@userAdityaa is attempting to deploy a commit to the shopstr-eng Team on Vercel.

A member of the Team first needs to authorize it.

@userAdityaa userAdityaa marked this pull request as ready for review April 5, 2026 22:07
Copilot AI review requested due to automatic review settings April 5, 2026 22:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR improves fetchProfile responsiveness by moving NIP-05 verification out of per-event serial awaits and into a concurrent batch, while restoring an early context update so profiles can render before verification completes.

Changes:

  • Added verifyProfilesNip05 helper to verify NIP-05 identifiers concurrently with Promise.allSettled.
  • Updated DB and relay profile parsing to stop awaiting verifyNip05Identifier inside loops.
  • Restored early editProfileContext update and added a follow-up update after verification completes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@userAdityaa userAdityaa force-pushed the fix-sequential-blocking branch from 7e629df to 8ecc6dd Compare April 5, 2026 22:26
@GautamBytes
Copy link
Copy Markdown
Contributor

LGTM

@GautamBytes GautamBytes self-assigned this Apr 6, 2026
@userAdityaa userAdityaa force-pushed the fix-sequential-blocking branch from 84dda09 to 06f4f06 Compare April 6, 2026 17:52
@userAdityaa
Copy link
Copy Markdown
Contributor Author

All merge conflicts have been resolved and the commits have been squashed!

@calvadev calvadev merged commit 6d1cc77 into shopstr-eng:main Apr 6, 2026
1 check failed
@userAdityaa userAdityaa deleted the fix-sequential-blocking branch April 6, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] fetchProfile blocks profile loading by awaiting NIP-05 HTTP verification sequentially inside a for-loop

4 participants