Files
grimoire/src/lib
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
..
2026-01-14 19:24:37 +01:00
2026-01-13 17:16:31 +01:00
2026-01-13 17:16:31 +01:00
2025-12-20 14:25:40 +01:00
2025-12-20 14:25:40 +01:00
👶
2025-12-09 16:26:31 +01:00
2025-12-14 12:00:55 +01:00
2025-12-14 12:21:09 +01:00
2025-12-17 11:44:12 +01:00
2025-12-20 14:25:40 +01:00
2025-12-18 16:00:56 +01:00
2025-12-18 16:00:56 +01:00
2025-12-18 16:00:56 +01:00
2025-12-18 16:25:34 +01:00
2025-12-20 14:25:40 +01:00
2025-12-15 11:36:06 +01:00
2025-12-15 13:11:59 +01:00
2025-12-14 15:14:14 +01:00
2025-12-22 13:25:38 +01:00
2025-12-18 16:49:24 +01:00
2025-12-11 00:09:26 +01:00
2025-12-20 14:25:40 +01:00
2025-12-14 12:00:55 +01:00
2025-12-20 14:25:40 +01:00
2026-01-15 16:13:50 +01:00
👶
2025-12-09 16:26:31 +01:00
2026-01-19 12:16:51 +01:00