Skip to content

feat(admin-panel): show session verified status in Account History - #21264

Merged
clouserw merged 1 commit into
mainfrom
fxa-14576
Sep 18, 2026
Merged

clouserw merged 1 commit into
mainfrom
fxa-14576

Conversation

@vbudhram

@vbudhram vbudhram commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Because

  • The Account History table in the Admin panel showed Event, Timestamp, IP, and Additional Info. It did not show the session verified flag, so support staff could not tell a verified sign in from an unverified one.
  • typeCasting in the admin server cast every MySQL TINY(1) column with field.string() === '1', so a SQL NULL became false.
  • securityEvents.verified is a nullable BOOLEAN column. The new column showed "No" for events that never set the flag, and the code that shows a dash never ran.

This pull request

  • Adds a "Verified" column to the Account History table, between IP and Additional Info.
  • Shows Yes or No with the panel's ResultBoolean component, and a grey dash when the value is null.
  • Fixes typeCasting to read field.string() once and return null when the field is null.
  • Widens verified to boolean | null in the admin server REST model and in the shared types that the panel imports.
  • Adds tests for the NULL cast and for the null render.

Issue that this pull request solves

Closes: FXA-14576

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on: database.service.ts for the cast, and PageAccountSearch/Account/index.tsx for the column.
  • Suggested review order: the cast first, then the widened types, then the panel column.
  • Risky or complex parts: typeCasting runs on every TINY(1) column that the admin server reads, not only on verified.

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

  • packages/fxa-admin-server/src/rest/model/account.model.ts and the security-events.model.ts that it imports are not imported anywhere. They are dead code, and this pull request leaves them in place.
  • An audit found no other admin server consumer that depends on a NULL TINY(1) becoming false. The only other nullable TINY(1) column, accounts.atLeast18AtReg, is not read by the admin server.

Copilot AI balanced review requested due to automatic review settings September 18, 2026 21:18
@vbudhram vbudhram added the auto label Sep 18, 2026
@vbudhram
vbudhram requested a review from a team as a code owner September 18, 2026 21:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

SQL null values currently become false, causing inapplicable events to display a misleading “No.”

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds session verification status to the Admin panel’s Account History table.

Changes:

  • Adds a Verified column using Yes/No/dash formatting.
  • Tests the header and verification states.
File summaries
File Description
Account/index.tsx Renders verification status for security events.
Account/index.test.tsx Tests the new column and displayed values.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

<>{securityEvent.name}</>
<>{getFormattedDate(securityEvent.createdAt)}</>
<>{securityEvent.ipAddr}</>
<>{formatVerified(securityEvent.verified)}</>
## Because

- The Account History table in the Admin panel showed Event, Timestamp, IP, and Additional Info. It did not show the session `verified` flag, so support staff could not tell a verified sign in from an unverified one.
- `typeCasting` in the admin server cast every MySQL TINY(1) column with `field.string() === '1'`, so a SQL NULL became `false`.
- `securityEvents.verified` is a nullable BOOLEAN column. The new column showed "No" for events that never set the flag, and the code that shows a dash never ran.

## This pull request

- Adds a "Verified" column to the Account History table, between IP and Additional Info.
- Shows Yes or No with the panel's `ResultBoolean` component, and a grey dash when the value is null.
- Fixes `typeCasting` to read `field.string()` once and return `null` when the field is null.
- Widens `verified` to `boolean | null` in the admin server REST model and in the shared types that the panel imports.
- Adds tests for the NULL cast and for the null render.

## Issue that this pull request solves

Closes: FXA-14576

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The database, type, rendering, and test changes consistently implement nullable verification status without unresolved issues.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

@clouserw
clouserw merged commit 9eb1641 into main Sep 18, 2026
21 checks passed
@clouserw
clouserw deleted the fxa-14576 branch September 18, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants