Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit account event for Pocket Apple user migration #15477

Merged
merged 1 commit into from
Jun 26, 2023
Merged

Emit account event for Pocket Apple user migration #15477

merged 1 commit into from
Jun 26, 2023

Conversation

vbudhram
Copy link
Contributor

Because

  • Pocket needs to do some account reconcilation after FxA imports the user

This pull request

  • Emits an account event via the event-broker that contains updated account information

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-7666

Checklist

  • 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).

Other information (Optional)

@dschom Tagging you for review on this since you reviewed the original script. I wasn't able to verify the SQS message, but I was able to test that the event gets emitted properly with the Pocket clientId.

Event broker log when running the script

18|event-broker  | 2023-06-23T16:34:15: DEBUG fxa-event-broker.default.from.sqsMessage: {"msg":{"uid":"14699a2d8b044ccbb2d43344e31d9e0a","appleEmail":"[email protected]","fxaEmail":"[email protected]","transferSub":"000107.r739567061c144a2b81c45269552ef591","success":true,"err":"","timestamp":1687552455789,"ts":1687552455.789,"iss":"localhost:9000","metricsContext":{},"event":"appleUserMigration"}}

@vbudhram vbudhram requested a review from a team as a code owner June 26, 2023 14:58
@vbudhram vbudhram self-assigned this Jun 26, 2023
Copy link
Contributor

@dschom dschom left a comment

Choose a reason for hiding this comment

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

LGTM!

I don't get why the topic prefix in the test is undefined, but other that than things seem good.

@@ -11,6 +11,10 @@ export const PROFILE_EVENT_ID =
export const SUBSCRIPTION_STATE_EVENT_ID =
'https://schemas.accounts.firefox.com/event/subscription-state-change';

export const APPLE_USER_MIGRATION_ID =
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there supposed to be something at this URL? I am guessing this okay, since there's no doc at the schema URL above either.

await (service as any).handleMessage(msg);

// topic prefix is undefined and clientId is always Pocket
const topicName = 'undefined749818d3f2e7857f';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the topic prefix undefined? Shouldn't the value just come from the config?

@vbudhram vbudhram merged commit 1540576 into main Jun 26, 2023
@vbudhram vbudhram deleted the fxa-7666 branch June 26, 2023 20:27
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