Area
Notification Service / Reliability
Complexity
Medium
File(s)
notification-service/src/listener.ts (fetchEvents, lines ~100-141; poll, lines ~166-203)
Problem
fetchEvents wraps server.getEvents(...) in its own try/catch and swallows any error, returning [] with only a console.error. Back in poll(), the caller has no way to know the fetch failed — it just sees zero events and unconditionally calls setLastLedger(latestLedger.sequence). So any transient RPC error while fetching events (as opposed to getLatestLedger, which correctly propagates to the outer catch and skips the cursor update) causes the cursor to jump past that ledger range anyway, permanently losing every ScoreChanged event that occurred in it. This is a different, unguarded failure path from the one exercised by the existing reconnect test, which only fails getLatestLedger.
Scope
In:
- Change fetchEvents to signal failure to the caller (rethrow or return a sentinel) so poll() skips setLastLedger on a failed fetch.
Out:
- Retry/backoff policy design for RPC calls in general.
Acceptance Criteria
Area
Notification Service / Reliability
Complexity
Medium
File(s)
notification-service/src/listener.ts (fetchEvents, lines ~100-141; poll, lines ~166-203)
Problem
fetchEvents wraps server.getEvents(...) in its own try/catch and swallows any error, returning [] with only a console.error. Back in poll(), the caller has no way to know the fetch failed — it just sees zero events and unconditionally calls setLastLedger(latestLedger.sequence). So any transient RPC error while fetching events (as opposed to getLatestLedger, which correctly propagates to the outer catch and skips the cursor update) causes the cursor to jump past that ledger range anyway, permanently losing every ScoreChanged event that occurred in it. This is a different, unguarded failure path from the one exercised by the existing reconnect test, which only fails getLatestLedger.
Scope
In:
Out:
Acceptance Criteria