fix(ai): handle db failures in session history fetch (#83)#125
fix(ai): handle db failures in session history fetch (#83)#125qscetxxxl wants to merge 1 commit into
Conversation
|
@qscetxxxl is attempting to deploy a commit to the rishabhmishra0510-5147's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR refines error handling in the AI service's session history retrieval method. Previously, a broad exception catch masked database failures by silently returning empty history. The changes now distinguish critical database connectivity loss ( ChangesAI Service Database Error Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
hey @qscetxxxl Let me know if you need any assistance! |
Description
Refactored
_fetch_session_historyinbackend/app/ai/service.pyto stop using broad exception blocks.OperationalErrorto raise a500 Internal Server Errorif the PostgreSQL database is entirely unreachable.SQLAlchemyErrorfor transient query issues to log them and safely return an empty list.Fixes #83
Summary by CodeRabbit