Skip to content

LG-13318: Ensure user_id present in account deletion submitted event#10887

Merged
aduth merged 3 commits intomainfrom
aduth-lg-13318-account-deleted-user
Jul 1, 2024
Merged

LG-13318: Ensure user_id present in account deletion submitted event#10887
aduth merged 3 commits intomainfrom
aduth-lg-13318-account-deleted-user

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Jun 28, 2024

🎫 Ticket

LG-13318

🛠 Summary of changes

Fixes analytics logging for account deletion event to ensure that the user ID is logged correctly

📜 Testing Plan

Verify you see user_id in logged events after deleting an account:

  1. Run make watch_events in a separate terminal process
  2. Go to http://localhost:3000
  3. Sign in to an account you don't mind deleting, or create a new account
  4. Click "Delete account" in account dashboard sidebar
  5. Confirm account deletion
  6. In terminal process for make watch_events, observe "Account Delete submitted" event includes a non-nil properties.user_id

Spec updates should provide regression assurance:

rspec spec/controllers/users/delete_controller_spec.rb

changelog: Internal, Analytics, Ensure user ID present in account deletion submitted
@aduth aduth requested a review from a team June 28, 2024 14:35
@aduth aduth changed the title LG-13318: Ensure user_id present in account deletion submitted LG-13318: Ensure user_id present in account deletion submitted event Jun 28, 2024
The issue was stub_analytics was _also_ being called and causing the controller to memoize analytics result in a way that wasn't previously surfaced since we asserted against analytics_user directly, despite the fact that the analytics method is what's actually used in code for logging
Signing out would cause current_user to always return nil. This change returns to previous implementation prior to #10573 with order of redirect

See: https://github.com/18F/identity-idp/pull/10887/files#r1661091791
@aduth aduth merged commit c052c3d into main Jul 1, 2024
@aduth aduth deleted the aduth-lg-13318-account-deleted-user branch July 1, 2024 14:31
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