Skip to content

feat(db): add passkey wrap security event names - #21022

Open
vpomerleau wants to merge 1 commit into
mainfrom
FXA-13139
Open

feat(db): add passkey wrap security event names#21022
vpomerleau wants to merge 1 commit into
mainfrom
FXA-13139

Conversation

@vpomerleau

@vpomerleau vpomerleau commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Because

  • The passkey wrap lifecycle has no audit trail.
  • Recent Activity shows "Other account activity" for any unrecognized name, so the names and their strings have to land together.

This pull request

  • Adds six account.passkey.wrap_* names in patch-195-196.sql with a commented-out reverse patch, mapped in security-event.ts.
  • Renders wrap_created, wrap_creation_failure and wrap_invalidated in Recent Activity; hides the other three, which restate rows the user already has.
  • Puts which step failed in additionalInfo.reason, so a new failure mode needs no migration.
  • Backfills ten already-shipped names in the test fixture, stale since id 50.

Nothing emits these events yet.

Issue that this pull request solves

Closes: FXA-13139

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)

  • patch-195-196.sql and EVENT_NAMES must agree exactly. The migration is immutable once published.
  • The no-unknown-fallback test clicks "Show more" first. Without it, feat(settings): show more account history events #21007's pagination hides every name past the 20th and the test passes vacuously.

Screenshots (Optional)

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

Other information (Optional)

  • The three new strings have no emitter yet, so they cannot be triggered — no screenshots.

Because:
* The passkey wrap lifecycle has no audit trail.
* Recent Activity shows "Other account activity" for any unrecognized
  name, so names and strings have to land together.

This commit:
* Adds six securityEventNames rows with a commented-out reverse patch,
  mapped in EVENT_NAMES.
* Renders creation, creation failure and invalidation; hides the two
  unlock events and the deletion cascade, which restate rows the user
  already has.
* Puts which step failed in additionalInfo.reason, so a new failure mode
  needs no migration.
* Adds a test that every non-hidden event name renders a real string.
* Brings the securityEventNames test fixture current -- stale since id 50.

Nothing emits these events yet.

Closes #FXA-13139
@vpomerleau
vpomerleau marked this pull request as ready for review August 13, 2026 20:13
@vpomerleau
vpomerleau requested review from a team as code owners August 13, 2026 20:13
Copilot AI balanced review requested due to automatic review settings August 13, 2026 20:13

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.

Pull request overview

Adds passkey-wrap lifecycle security event definitions and Recent Activity presentation support. Event emission remains future work.

Changes:

  • Adds six database event names and shared ID mappings.
  • Displays three user-relevant events while hiding duplicate/internal events.
  • Adds localization and complete-label regression coverage.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/fxa-shared/test/db/models/auth/security-event-names.sql Updates the test fixture with recent event names.
packages/fxa-shared/db/models/auth/security-event.ts Maps passkey-wrap names to IDs 61–66.
packages/fxa-settings/src/components/Settings/PageRecentActivity/SecurityEvent.tsx Maps visible labels and hides redundant events.
packages/fxa-settings/src/components/Settings/PageRecentActivity/index.test.tsx Tests labels beyond the initial 20 rows.
packages/fxa-settings/src/components/Settings/PageRecentActivity/en.ftl Adds English localized strings.
packages/db-migrations/databases/fxa/target-patch.json Advances the target schema to 196.
packages/db-migrations/databases/fxa/patches/patch-196-195.sql Documents the disabled reverse migration.
packages/db-migrations/databases/fxa/patches/patch-195-196.sql Adds the six event names.

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

@vpomerleau vpomerleau self-assigned this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants