nostrrelay/relay
PatMulligan 687d7b89c1
Fix REQ message handling to support multiple filter subscriptions (#34)
This fix addresses an issue where REQ messages with multiple filters
were being rejected by the relay. Notably: The nostrmarket extension's
"Refresh from Nostr" functionality sends a single REQ message containing
4 different filter subscriptions:
- Direct Messages (kinds: [4])
- Stalls (kinds: [30017])
- Products (kinds: [30018])
- Profile (kinds: [0])

Changes:
- Changed validation from `len(data) != 3` to `len(data) < 3` to allow
multiple filters
- Added loop to process all filters in a single REQ message (data[2:])
- Accumulate responses from all filters before returning

This ensures compatibility with clients that batch multiple subscription
filters in a single REQ message, which is a valid pattern according to
NIP-01.
2025-09-10 16:35:25 +03:00
..
__init__.py refactor: extract client_connection 2023-02-17 14:44:39 +02:00
client_connection.py Fix REQ message handling to support multiple filter subscriptions (#34) 2025-09-10 16:35:25 +03:00
client_manager.py feat: improve codequality and CI (#25) 2024-08-30 13:20:23 +02:00
event.py [fix] Ws api tests (#31) 2024-11-11 15:25:25 +02:00
event_validator.py feat: improve codequality and CI (#25) 2024-08-30 13:20:23 +02:00
filter.py feat: update to v1.0.0 (#30) 2024-11-08 15:32:04 +02:00
relay.py feat: update to v1.0.0 (#30) 2024-11-08 15:32:04 +02:00