---
name: "Matrix bot crashes on transient network error instead of retrying"
---

# Bug 419: Matrix bot crashes on transient network error instead of retrying

## Description

The Matrix bot treats a transient sync error as fatal and stops entirely. A single failed HTTP request to the homeserver kills the bot, requiring a full server rebuild to recover.

## How to Reproduce

1. Run storkit with Matrix bot enabled\n2. Homeserver becomes temporarily unreachable (network blip, DNS hiccup, server restart)\n3. Bot hits sync error and crashes

## Actual Result

Bot logs "Fatal error: Matrix sync error: error sending request for url (...)" and stops responding. No retry, no recovery.

## Expected Result

Bot logs a warning, backs off with exponential delay, and retries the sync. Only crash on unrecoverable errors (invalid credentials, banned, etc).

## Acceptance Criteria

- [ ] Transient network errors (connection refused, timeout, DNS failure) trigger a retry with exponential backoff
- [ ] Bot logs a warning on each failed retry attempt
- [ ] Bot resumes normal operation once the homeserver is reachable again
- [ ] Unrecoverable errors (401, 403) still cause a clean shutdown with a clear error message
- [ ] Bot sends a notification after recovering from a network outage
