1. mock-log 500 (HIGH) — schema drift: the live demo DB's whatsapp_log table predates the columns the app queries (message_text, wa_message_id, ticket_number). ensure_legacy_schema (startup legacy shim) now self-heals legacy whatsapp_log tables idempotently: adds the missing columns, backfills message_text from legacy content where possible, drops the obsolete command column. New producer/consumer test proves a legacy-shaped table gains columns at startup and mock-log returns 200.
2. Role alias gap (MED) — cs_rep / cs_manager / fm_dispatcher (underscore forms) were unmapped in ROLE_ALIASES (only space forms mapped), so startup role normalization could never converge them and frontend exact-match routing sent those users to /tickets. Added the underscore aliases → canonical roles.
Both fixes apply through the app's own startup path so every legacy DB self-heals on deploy — no manual DB surgery. Test user 18 (test@denya.com) itself was deleted from the live DB by firstmate (deployer-owned cleanup, verified gone; all 17 remaining users carry canonical roles).
Captain-approved fix batch (relay #747 follow-up), no-mistakes validated (run 01M233QWPSRVJEQDPC9ENDEDTX, 0 findings, 90 tests green).
**1. mock-log 500 (HIGH)** — schema drift: the live demo DB's `whatsapp_log` table predates the columns the app queries (`message_text`, `wa_message_id`, `ticket_number`). `ensure_legacy_schema` (startup legacy shim) now self-heals legacy whatsapp_log tables idempotently: adds the missing columns, backfills `message_text` from legacy content where possible, drops the obsolete `command` column. New producer/consumer test proves a legacy-shaped table gains columns at startup and mock-log returns 200.
**2. Role alias gap (MED)** — `cs_rep` / `cs_manager` / `fm_dispatcher` (underscore forms) were unmapped in `ROLE_ALIASES` (only space forms mapped), so startup role normalization could never converge them and frontend exact-match routing sent those users to /tickets. Added the underscore aliases → canonical roles.
Both fixes apply through the app's own startup path so every legacy DB self-heals on deploy — no manual DB surgery. Test user 18 (test@denya.com) itself was deleted from the live DB by firstmate (deployer-owned cleanup, verified gone; all 17 remaining users carry canonical roles).
CT115 (Mumuni relay #747) — two live-instance defects after PR #12:
1. GET /api/whatsapp/mock-log 500'd with a valid admin token:
'no such column: whatsapp_log.message_text'. The model gained
message_text/wa_message_id/ticket_number (and dropped command) in
4afdc36 with no migration, so legacy DBs keep the (command, ...) shape.
ensure_legacy_schema (startup, app/main.py) now adds the three missing
columns idempotently and backfills legacy command bodies into
message_text before dropping the obsolete NOT NULL command column, so
both the mock-log read path and the ORM write path work on healed DBs.
New producer/consumer regression (tests/test_whatsapp_log_legacy_heal.py)
reproduces the exact OperationalError, then asserts 200 + data.
2. ROLE_ALIASES gap: underscore legacy roles (cs_rep, cs_manager,
fm_dispatcher) were not mapped, so normalize_legacy_user_roles could not
converge rows like user 18 (test@denya.com, role 'cs_rep') and the
frontend stranded them on /tickets. Added the underscore aliases; tests
assert normalize_role('cs_rep') == 'CS Rep' and a cs_rep row converges
and authenticates.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Captain-approved fix batch (relay #747 follow-up), no-mistakes validated (run 01M233QWPSRVJEQDPC9ENDEDTX, 0 findings, 90 tests green).
1. mock-log 500 (HIGH) — schema drift: the live demo DB's
whatsapp_logtable predates the columns the app queries (message_text,wa_message_id,ticket_number).ensure_legacy_schema(startup legacy shim) now self-heals legacy whatsapp_log tables idempotently: adds the missing columns, backfillsmessage_textfrom legacy content where possible, drops the obsoletecommandcolumn. New producer/consumer test proves a legacy-shaped table gains columns at startup and mock-log returns 200.2. Role alias gap (MED) —
cs_rep/cs_manager/fm_dispatcher(underscore forms) were unmapped inROLE_ALIASES(only space forms mapped), so startup role normalization could never converge them and frontend exact-match routing sent those users to /tickets. Added the underscore aliases → canonical roles.Both fixes apply through the app's own startup path so every legacy DB self-heals on deploy — no manual DB surgery. Test user 18 (test@denya.com) itself was deleted from the live DB by firstmate (deployer-owned cleanup, verified gone; all 17 remaining users carry canonical roles).