Alejandro c52e783fce fix(nip-29): fetch admin and member lists in parallel and correctly tag admins (#169)
* fix(nip-29): fetch admin and member lists in parallel and correctly tag admins

This commit improves NIP-29 group member fetching with two key changes:

1. **Parallel fetching**: Admins (kind 39001) and members (kind 39002) are now
   fetched in parallel using separate subscriptions, improving performance

2. **Correct admin role tagging**: Users in kind 39001 events now correctly
   default to "admin" role instead of "member" when no explicit role tag is
   provided, as per NIP-29 spec

Changes:
- Split participantsFilter into separate adminsFilter and membersFilter
- Use Promise.all to fetch both kinds in parallel
- Updated normalizeRole helper to accept a defaultRole parameter
- Process kind 39001 with "admin" default, kind 39002 with "member" default
- Added clearer logging for admin/member event counts

Related: src/lib/chat/adapters/nip-29-adapter.ts:192-320

* refactor(nip-29): simplify parallel fetch using pool.request

Use pool.request() with both filters in a single call instead of manual
subscription management. This is cleaner and more idiomatic:
- Auto-closes on EOSE (no manual unsubscribe needed)
- Fetches both kinds (39001 and 39002) in parallel with one request
- Reduces code complexity significantly

* fix(nip-29): use limit 1 for replaceable participant events

Kinds 39001 and 39002 are replaceable events with d-tag, so there should
only be one valid event of each kind per group. Changed limit from 5 to 1.

* fix(chat): change "Sign in to send messages" to "Sign in to post"

Simplified the login prompt text in chat interface for clarity.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-20 11:41:51 +01:00
2025-12-18 15:46:02 +01:00
2025-12-19 12:49:29 +01:00
2025-12-22 20:40:16 +00:00
2025-12-20 14:25:40 +01:00
2026-01-14 19:24:37 +01:00
2025-12-14 16:50:16 +01:00

Grimoire

A Nostr protocol explorer and developer tool with a tiling window manager interface.

Features

  • Tiling Windows - Each window is a Nostr "app" (profile viewer, event feed, NIP docs, etc.)
  • Command Palette - Unix-style commands via Cmd+K to open apps and navigate
  • Multi-workspace - Virtual desktops with independent layouts
  • Real-time - Reactive event subscriptions with automatic updates

Stack

React 19, TypeScript, Vite, TailwindCSS, Jotai, Dexie, Applesauce

Getting Started

npm install
npm run dev

Scripts

Command Description
npm run dev Start dev server
npm run build Build for production
npm test Run tests in watch mode
npm run lint Lint code
npm run format Format code

License

MIT

Description
No description provided
Readme MIT 14 MiB
Languages
TypeScript 98.9%
CSS 0.8%
JavaScript 0.3%