Currently, when the NostrClient processes a burst of video events (e.g., initial
feed load), it triggers an individual NIP-71 metadata fetch for every video that
updates the `activeMap`. This results in a stampede of network requests (N videos
* M relays).
This change optimizes `flushEventBuffer` to collect all videos requiring metadata
updates and executes a single batched `populateNip71MetadataForVideos` call at
the end of the flush cycle.
This reduces the metadata fetch overhead from O(N) to O(1) per batch.
Verified with a local benchmark script (reduced fetch calls from 50 to 1 for 50 events)
and existing unit tests.
Co-authored-by: PR0M3TH3AN <[email protected]>