mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
Manual test showed the previous sequential loop over recommendations timed out the overall budget when a well-connected account produced 23 outbox-relay recommendations (23 x 4s per-relay = 92s worst case). Refactor: build one filterMap keyed by recommendation.relay and issue a single client.subscribe. All relays fan out in parallel; the per-relay EOSE gate bounds the wait regardless of set size. Phase 3 fallback gets the same shape for consistency. Also: - Bump overallTimeoutMs default from 8s -> 20s (belt only; parallel Phase 2 makes it unlikely to trip). - Log OVERALL TIMEOUT when withTimeoutOrNull returns null so reviewers can distinguish 'ran fine, no data' from 'timed out'. - Add per-phase debug logs (start / phase1 done / phase2 recommendations and done / phase3 fallback and done) so the outbox pipeline is auditable without a debugger. Existing 7 OutboxDispatcher tests still pass.