feat: add friendly error messages, MailDebugRecorder, clear-error endpoint, debug_logging column

Agent-Logs-Url: https://github.com/christianlouis/InboxConverge/sessions/5d2918de-630e-4a66-8355-1b036c620b1c

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-03 18:43:06 +00:00
committed by GitHub
parent 0026afe131
commit db893d05e9
8 changed files with 826 additions and 31 deletions
@@ -0,0 +1,37 @@
"""Add debug_logging column to mail_accounts
Revision ID: 0002
Revises: 0001
Create Date: 2026-05-03
Adds a boolean ``debug_logging`` column to ``mail_accounts``.
When True, the next processing run will record a detailed connection trace
(timings, phase-by-phase events, message UIDs/sizes) and persist it as a
``ProcessingLog`` row with ``level='DEBUG'``. The column auto-resets to
False after 5 completed runs in a 24-hour window to prevent it being left
on indefinitely.
The column defaults to False so all existing rows are unaffected.
Using IF NOT EXISTS makes the migration idempotent against fresh installs
where create_all() already created the column.
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "0002"
down_revision = "0001"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.execute(
"ALTER TABLE mail_accounts "
"ADD COLUMN IF NOT EXISTS debug_logging BOOLEAN NOT NULL DEFAULT FALSE"
)
def downgrade() -> None:
op.execute("ALTER TABLE mail_accounts DROP COLUMN IF EXISTS debug_logging")