enhance: add audit logging from UI and more logging from auth#4946
enhance: add audit logging from UI and more logging from auth#4946rschlaefli wants to merge 6 commits into
Conversation
…-log # Conflicts: # .gitignore # apps/auth/package.json # pnpm-lock.yaml
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # .gitignore
Review of PR #4946 with evidence (file:line), findings on frontend behavior regressions, event delivery/fallback, i18n, and auth flow latency, plus ordered instructions to finish the PR.
| }, [ | ||
| auditLog, | ||
| currentInstance, | ||
| execution, | ||
| isAssessmentMode, | ||
| isStaticPreview, | ||
| quizId, | ||
| ]) |
There was a problem hiding this comment.
Autosave Timer Keeps Restarting
When a participant edits an answer, QuestionArea re-renders and useAuditClient() supplies a new wrapper object for auditLog. Because this effect depends on that object, it clears and recreates the 10-second interval on each render, so active typing can prevent temporary response saves and answer-update audit events from ever firing.
| ? (locale as (typeof routing.locales)[number]) | ||
| : routing.defaultLocale | ||
|
|
||
| const pageComponent = <Component key={router.asPath} {...pageProps} /> |
There was a problem hiding this comment.
router.asPath includes the query string, so any router.push or router.replace that changes a query parameter gives the page a new key. That unmounts and remounts the whole page tree, which can drop local assessment state such as in-progress quiz answers, scroll position, and mounted refs even though the user stayed on the same page.
| // Ensure the transaction returns the participant for the caller | ||
| return participant | ||
| }) | ||
| await flushAuditEvents(invitationAuditEvents) |
There was a problem hiding this comment.
This awaits best-effort audit delivery in the participant sign-in path after the transaction has already committed. If the audit service is slow or unreachable, AuditClient.log() retries with network timeouts before NextAuth can finish the Edu-ID login, so a degraded audit service can make successful participant logins hang or time out.
ClickUp Links