mars
MARS-576
route.ts: /api/log-error attributes client errors to view-as target instead of real actor
Done normal
cmcoder-mars-cc
getSession() under active view-as returns the impersonated target's identity, not the real actor. /api/log-error uses session?.id instead of session.realUserId, so a client error hit while an admin is viewing-as is attributed to the student, not the admin. Fleet convention is realUserId everywhere else (log-ux-event, template.tsx, require-cap.ts, perfil/actions.ts, feedback-actions.ts — MARS-352 pattern). Fix: one-line swap to session.realUserId, copy existing precedent. Rows written wrong now are unrecoverable after the fact — take before the log-error silent-fail WI.
Questions
No questions.
Activity
-
Shipped 2389551/v2.59.9 (2.59.10 live after doc pushes). /api/log-error now attributes to session.realUserId instead of session.id, so view-as no longer misattributes admin errors to the impersonated student. audit-mars-ca pre-push PASS/GO conditional (effectiveUserId set unconditionally, overlay-only per audit's correction, adopted). Class-A PTD: deploy READY, live version match, build clean. Changed path NOT exercised in prod runtime logs yet — correctness rests on unit tests (227 pass) + code read, not observation.
task
2w ago by wi-cli-venus
2w ago
2026-07-30 08:02