Introduce comprehensive integration tests for Neo4j bug fixes covering batching, event relationships, and processing logic. Add rate-limiting to Neo4j queries using semaphores and retry policies to prevent authentication rate limiting and connection exhaustion, ensuring system stability under load.
Merged 'Author' nodes into 'NostrUser' for unified identity tracking and social graph representation. Introduced migrations framework to handle schema changes, including retroactive updates for existing relationships and constraints. Updated tests, schema definitions, and documentation to reflect these changes.
1. Added Err() method to CollectedResult (pkg/neo4j/neo4j.go:68-72):
- The resultiter.Neo4jResultIterator interface requires Err() error
- CollectedResult was missing this method, causing the type assertion to fail
- Since CollectedResult pre-fetches all records, Err() always returns nil
2. Fixed nil pointer dereference in buildCypherQuery (pkg/neo4j/query-events.go:173):
- Changed if *f.Limit > 0 to if f.Limit != nil && *f.Limit > 0
- This prevents a panic when filters don't specify a limit
3. Simplified parseEventsFromResult signature (pkg/neo4j/query-events.go:185):
- Changed from func (n *N) parseEventsFromResult(result any) to accept *CollectedResult directly
- This eliminates the runtime type assertion since ExecuteRead already returns *CollectedResult
- Removed the now-unused resultiter import
Replaced individual environment variable access with a unified `DatabaseConfig` struct for all database backends. This centralizes configuration management, reduces redundant code, and ensures all options are documented in `app/config/config.go`. Backward compatibility is maintained with default values and retained constructors.