failedEvents method
- int limit = 50,
Just the failed rows — convenience for the "Needs attention"
list, which doesn't want to show pending/syncing rows because
those resolve on their own.
Implementation
List<OutboxEvent> failedEvents({int limit = 50}) {
_requireReady();
final rs = _db!.select(
'''
SELECT * FROM outbox_events
WHERE state = 'failed'
ORDER BY last_attempt_at DESC NULLS LAST, created_at ASC
LIMIT ?
''',
[limit],
);
return rs.map(OutboxEvent.fromRow).toList(growable: false);
}