chihlasm
a48660700a
fix: background jobs and lifespan must use BYPASSRLS sessions
All code that runs outside a request context (APScheduler jobs,
lifespan startup) has no app.current_account_id set, so the
app-role session returns 0 rows from every RLS-protected table.
Changed to _admin_session_factory (BYPASSRLS) in:
- knowledge_flywheel_scheduler.py — queries ai_sessions
- psa_retry_scheduler.py — queries psa_post_log
- retention_cleanup.py — queries assistant_chats
- scheduler.py (_fire_maintenance_schedule, _cleanup_expired_ai_conversations)
- main.py (archive_stale_ai_sessions, _process_notification_retries,
load_all_schedules at startup)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 03:44:23 +00:00
..
2026-03-19 20:35:39 +00:00
2026-02-08 08:14:22 -05:00
2026-04-07 13:09:16 +00:00
2026-03-24 08:36:13 +00:00
2026-04-11 04:24:36 +00:00
2026-04-09 00:41:30 -04:00
2026-03-04 20:44:25 -05:00
2026-03-20 03:34:54 +00:00
2026-03-18 14:27:36 +00:00
2026-04-05 15:18:31 +00:00
2026-04-11 04:24:36 +00:00
2026-04-12 03:44:23 +00:00
2026-03-21 03:25:25 +00:00
2026-03-19 05:12:10 +00:00
2026-03-21 03:25:25 +00:00
2026-03-19 12:37:54 +00:00
2026-04-10 06:44:17 +00:00
2026-04-12 03:44:23 +00:00
2026-03-05 11:41:22 -05:00
2026-02-14 00:11:20 -05:00
2026-04-10 06:44:17 +00:00
2026-04-12 03:44:23 +00:00
2026-04-12 01:25:28 +00:00
2026-03-14 20:18:59 -04:00
2026-03-20 04:36:12 +00:00
2026-03-21 03:25:25 +00:00
2026-03-19 20:35:45 +00:00
2026-03-27 21:08:12 +00:00
2026-03-04 20:44:25 -05:00
2026-02-10 09:45:26 -05:00
2026-02-10 09:45:26 -05:00
2026-02-10 09:45:26 -05:00
2026-04-07 06:31:24 +00:00
2026-02-10 09:45:26 -05:00