- New caching_custom_backfill_jobs and caching_custom_backfill_batches tables
- Admin API (POST create/cancel, GET list) at admin/api/custom_backfill.php
- Admin UI form with preset buttons and job status table on Backfill page
- Caching daemon module (custom_backfill.c) processes jobs independently
- pg_inbox functions for job/batch claim, progress update, and cancel
- Three batch modes: author-batched, id-batched, time-window scan
- Fixed done_batches overcount on job completion
- Admin config now environment-variable driven (C_RELAY_DB_*)
- admin/serve.sh supports separate instances for different databases
- make_and_restart_relay.sh only kills relay on target port, not all relays
Previously, send_notice_message() called queue_message() with NULL pss, causing
all NOTICE messages to fail silently. This affected filter validation errors
(e.g., invalid kinds > 65535 per NIP-01) where clients received no response.
Changes:
- Updated send_notice_message() signature to accept struct per_session_data* pss
- Updated 37 call sites across websockets.c (31) and nip042.c (6)
- Updated forward declarations in main.c, websockets.c, and nip042.c
- Added tests/invalid_kind_test.sh to verify NOTICE responses for invalid filters
Fixes issue where REQ with kinds:[99999] received no response instead of NOTICE.
- Move non-NIP-17 admin functions from dm_admin.c to api.c for better architecture
- Add NIP-44 encryption to send_admin_response() for secure admin responses
- Implement SQL query validation and execution with safety limits
- Add unified SQL query handler for admin API
- Fix buffer size for encrypted content to handle larger responses
- Update function declarations and includes across files
- Successfully test frontend query execution through web interface
- **Auth Rules Implementation**: Added blacklist/whitelist enforcement in websockets.c
- Events are now checked against auth_rules table before acceptance
- Blacklist blocks specific pubkeys, whitelist enables allow-only mode
- Made check_database_auth_rules() public for cross-module access
- **Subscription Filtering Fixes**:
- Added missing 'ids' filter support in SQL query building
- Fixed test expectations to not require exact event counts for kind filters
- Improved filter validation and error handling
- **Ephemeral Events Compliance**:
- Modified SQL queries to exclude kinds 20000-29999 from historical queries
- Maintains broadcasting to active subscribers while preventing storage/retrieval
- Ensures NIP-01 compliance for ephemeral event handling
- **Comprehensive Testing**:
- Created white_black_test.sh with full blacklist/whitelist functionality testing
- Tests verify blocked posting for blacklisted users
- Tests verify whitelist-only mode when whitelist rules exist
- Includes proper auth rule clearing between test phases
- **Code Quality**:
- Added proper function declarations to websockets.h
- Improved error handling and logging throughout
- Enhanced test script with clear pass/fail reporting