fix: recover redis connections and preserve encrypted names - #58
lorenzocorallo wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe pull request widens encrypted Telegram name columns to 512 characters and adds migration and repair support. It also changes Redis reconnect handling to continue retrying after exhausted attempts and adds recovery tests. ChangesEncrypted Unicode name capacity
Redis reconnect recovery
Sequence Diagram(s)sequenceDiagram
participant RedisClient
participant reconnectStrategy
participant RedisServer
RedisClient->>RedisServer: connect
RedisServer-->>RedisClient: connection unavailable
RedisClient->>reconnectStrategy: request retry delay
reconnectStrategy-->>RedisClient: exponential delay with jitter
RedisClient->>RedisServer: reconnect
RedisServer-->>RedisClient: HELLO and RPUSH responses
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to The widened name columns safely accommodate validated encrypted names, and no actionable current-head risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (5 skipped: 5 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Redis outages permanently closed the backend client after its retry budget expired. Keep reconnecting with capped exponential backoff and jitter. Valid Unicode Telegram names also exceeded the encrypted-name columns: a 64-character Chinese name becomes 442 ciphertext characters. Widen both name columns from 192 to 512 and record migration 0019 without truncating existing values.
Validation: 24 tests, type checking, Biome on changed TypeScript and production build passed. Real Redis-client outage regressions cover delayed startup and loss of an established connection. PostgreSQL 17.4 migration checks preserved existing rows, accepted 442-character values and passed when reapplied.
Production already received the bounded two-column repair after a verified backup and row-content/heap comparison of all 11,341 existing rows. A same-image backend rollout refreshed prepared statements; the bot then saved 1,141 previously blocked users. The migration records that repair for normal deployments. Source changes are not yet deployed. Do not narrow these columns during rollback or run unrelated pending migrations as an incident repair.
The PostgreSQL memory-retention cause remains unresolved. A proposed Bun idle timeout killed an active query in a local test and was excluded from this change.
Related incident PRs: telegram, polinetwork-cd, terraform.