Skip to content

feat(cloud tasks): add route handler for inactive notification cloud tasks#18212

Merged
chenba merged 1 commit intomainfrom
FXA-10572-create-cloud-task-endpoint
Jan 14, 2025
Merged

feat(cloud tasks): add route handler for inactive notification cloud tasks#18212
chenba merged 1 commit intomainfrom
FXA-10572-create-cloud-task-endpoint

Conversation

@chenba
Copy link
Copy Markdown
Contributor

@chenba chenba commented Jan 12, 2025

Because:

  • we need an endpoint to accept the requests of the inactive account deletion email notification cloud tasks

This commit:

  • adds the endpoint and handler
  • adds task auto-rescheduling based on a new delivery time option
  • refactors/updates some code to rely on the auto-rescheduling feature

@chenba chenba requested a review from a team as a code owner January 12, 2025 22:33
@chenba chenba force-pushed the FXA-10572-create-cloud-task-endpoint branch from 5f6f4f2 to b0997d7 Compare January 12, 2025 23:51
Copy link
Copy Markdown
Contributor

@vbudhram vbudhram left a comment

Choose a reason for hiding this comment

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

@chenba Thanks for the comments and descriptions 👍🏽

httpMethod: 1, // POST
headers: {
'Content-Type': 'application/json',
'fxa-cloud-task-delivery-time': '1741684000000',
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.

Might make sense to pull these into a constant with deliveryTime above.


const { cloudTaskRoutes } = require('./cloud-tasks');
const cloudTasks = cloudTaskRoutes(log, config);
const cloudTasks = cloudTaskRoutes(log, config, statsd);
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.

Stinks that statsd is passed in vs DI. We have been using it in alot more places.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I usually try to be consistent with what's already in place.

…tasks

Because:
 - we need an endpoint to accept the requests of the inactive account
   deletion email notification cloud tasks

This commit:
 - adds the endpoint and handler
 - adds task auto-rescheduling based on a new delivery time option
 - refactors/updates some code to rely on the auto-rescheduling feature
@chenba chenba force-pushed the FXA-10572-create-cloud-task-endpoint branch from b0997d7 to b6ada73 Compare January 14, 2025 15:35
@chenba
Copy link
Copy Markdown
Contributor Author

chenba commented Jan 14, 2025

The failing functional test is a known issue.

@chenba chenba merged commit 742ac01 into main Jan 14, 2025
@chenba chenba deleted the FXA-10572-create-cloud-task-endpoint branch January 14, 2025 16:29
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.

2 participants