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-01-22 14:38:53 -05:00
2026-04-10 07:12:45 +00:00
2026-03-21 03:25:25 +00:00
2026-02-23 00:03:54 -05:00
2026-03-21 03:25:25 +00:00
2026-03-28 23:02:35 +00:00
2026-03-04 20:44:25 -05:00
2026-03-21 03:25:25 +00:00
2026-03-16 13:39:17 -04:00
2026-04-11 07:02:35 +00:00
2026-04-10 04:03:32 +00:00
2026-04-10 03:49:49 +00:00
2026-03-19 12:37:54 +00:00
2026-04-09 00:42:19 -04:00
2026-03-21 03:25:25 +00:00
2026-03-11 23:29:51 -04:00
2026-01-27 20:39:09 -05:00
2026-03-20 06:05:20 +00:00
2026-03-14 20:18:59 -04:00
2026-02-05 22:44:05 -05:00
2026-04-12 03:44:23 +00:00
2026-03-18 02:38:42 +00:00
2026-03-04 20:44:25 -05:00
2026-04-12 02:44:36 +00:00
2026-02-23 00:03:54 -05:00
2026-02-08 06:05:59 -05:00
2026-03-11 01:59:03 -04:00
2026-02-07 02:38:47 -05:00
2026-02-07 02:38:47 -05:00
2026-04-10 03:48:34 +00:00
2026-03-16 13:39:17 -04:00