Skip to content

LG-12294: Fix asynchronous email delivery for aggregated sign-in email#10421

Merged
aduth merged 3 commits intomainfrom
aduth-async-email-new-device
Apr 15, 2024
Merged

LG-12294: Fix asynchronous email delivery for aggregated sign-in email#10421
aduth merged 3 commits intomainfrom
aduth-async-email-new-device

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Apr 12, 2024

🎫 Ticket

Supplemental fix for LG-12294

🛠 Summary of changes

Fixes an issue where asynchronous delivery of aggregated new device sign-in email notifications raises an error, due to non-serializable arguments.

     ActiveJob::SerializationError:
       Unsupported argument type: ActiveRecord::AssociationRelation

Related Slack discussion: https://gsa-tts.slack.com/archives/C0NGESUN5/p1712932922568999

📜 Testing Plan

  1. Add deliver_mail_async: true to config/application.yml
  2. In a private browsing window (Incognito), go to http://localhost:3000
  3. Sign in and MFA
  4. Observe no errors after fully authenticated

changelog: Upcoming Features, Sign In, Send single aggregated email notification for new device sign-in
@aduth aduth requested review from a team and mitchellhenke April 12, 2024 17:07
@aduth aduth changed the title Fix asynchronous email delivery for aggregated sign-in email LG-12294: Fix asynchronous email delivery for aggregated sign-in email Apr 12, 2024
'sign_in_after_2fa',
],
).order(:created_at).includes(:device)
).order(:created_at).includes(:device).to_a
Copy link
Contributor

Choose a reason for hiding this comment

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

Not worth blocking this fix, but I think we could consider a limit here on the outside chance that there are an incredible number of events.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll follow-up with you separately on this. I agree with the general premise, but I'd have some concern about limiting what we show here.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe if there are more we just get the count of the rest and say something like "and 15 more devices"

@aduth aduth merged commit 1a0ba9c into main Apr 15, 2024
@aduth aduth deleted the aduth-async-email-new-device branch April 15, 2024 12:06
@mitchellhenke mitchellhenke mentioned this pull request Apr 16, 2024
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