diff --git a/packages/fxa-auth-server/lib/profile/updates.js b/packages/fxa-auth-server/lib/profile/updates.js index 66e2a57df6..66dc7d1acc 100644 --- a/packages/fxa-auth-server/lib/profile/updates.js +++ b/packages/fxa-auth-server/lib/profile/updates.js @@ -20,7 +20,7 @@ module.exports = function (log) { // server is also listening for these events but will only // clear its cache when received. await log.notifyAttachedServices( - 'profileDataChanged', + 'profileDataChange', {}, { uid, diff --git a/packages/fxa-auth-server/lib/routes/subscriptions/stripe.ts b/packages/fxa-auth-server/lib/routes/subscriptions/stripe.ts index d6deb88c9a..86eae174e6 100644 --- a/packages/fxa-auth-server/lib/routes/subscriptions/stripe.ts +++ b/packages/fxa-auth-server/lib/routes/subscriptions/stripe.ts @@ -130,7 +130,7 @@ export class StripeHandler { this.profile.deleteCache(uid), ]); await this.push.notifyProfileUpdated(uid, devices); - this.log.notifyAttachedServices('profileDataChanged', request, { + this.log.notifyAttachedServices('profileDataChange', request, { uid, email, }); diff --git a/packages/fxa-auth-server/lib/routes/totp.js b/packages/fxa-auth-server/lib/routes/totp.js index 3e6b9cf68e..30d729546a 100644 --- a/packages/fxa-auth-server/lib/routes/totp.js +++ b/packages/fxa-auth-server/lib/routes/totp.js @@ -155,7 +155,7 @@ module.exports = (log, db, mailer, customs, config) => { // See #5154. await db.verifyTokensWithMethod(sessionToken.id, 'email-2fa'); - await log.notifyAttachedServices('profileDataChanged', request, { + await log.notifyAttachedServices('profileDataChange', request, { uid, }); @@ -305,7 +305,7 @@ module.exports = (log, db, mailer, customs, config) => { tokenId: sessionToken && sessionToken.id, }); - await log.notifyAttachedServices('profileDataChanged', request, { + await log.notifyAttachedServices('profileDataChange', request, { uid: sessionToken.uid, }); } diff --git a/packages/fxa-auth-server/test/local/profile/updates.js b/packages/fxa-auth-server/test/local/profile/updates.js index 732735a5f8..1e40469079 100644 --- a/packages/fxa-auth-server/test/local/profile/updates.js +++ b/packages/fxa-auth-server/test/local/profile/updates.js @@ -69,7 +69,7 @@ describe('profile updates', () => { assert.ok( log.notifyAttachedServices.calledWithExactly( - 'profileDataChanged', + 'profileDataChange', {}, { uid } ) diff --git a/packages/fxa-auth-server/test/local/routes/subscriptions/stripe.js b/packages/fxa-auth-server/test/local/routes/subscriptions/stripe.js index 7586169d3a..cfc1031663 100644 --- a/packages/fxa-auth-server/test/local/routes/subscriptions/stripe.js +++ b/packages/fxa-auth-server/test/local/routes/subscriptions/stripe.js @@ -530,7 +530,7 @@ describe('DirectStripeRoutes', () => { assert.isTrue( directStripeRoutesInstance.log.notifyAttachedServices.calledOnceWith( - 'profileDataChanged', + 'profileDataChange', VALID_REQUEST, { uid: UID, email: TEST_EMAIL } ), diff --git a/packages/fxa-auth-server/test/local/routes/totp.js b/packages/fxa-auth-server/test/local/routes/totp.js index 41714d3225..a89a4f6c44 100644 --- a/packages/fxa-auth-server/test/local/routes/totp.js +++ b/packages/fxa-auth-server/test/local/routes/totp.js @@ -131,7 +131,7 @@ describe('totp', () => { ); assert.equal( args[0], - 'profileDataChanged', + 'profileDataChange', 'first argument was event name' ); assert.equal(args[1], request, 'second argument was request object'); @@ -235,7 +235,7 @@ describe('totp', () => { ); assert.equal( args[0], - 'profileDataChanged', + 'profileDataChange', 'first argument was event name' ); assert.equal(args[1], request, 'second argument was request object'); diff --git a/packages/fxa-profile-server/lib/events.js b/packages/fxa-profile-server/lib/events.js index a8ad8907a1..cafe9418b9 100644 --- a/packages/fxa-profile-server/lib/events.js +++ b/packages/fxa-profile-server/lib/events.js @@ -55,12 +55,12 @@ module.exports = function (server) { }); } - function profileDataChanged(message) { + function profileDataChange(message) { var userId = getUserId(message); return P.resolve() .then(function () { server.methods.profileCache.drop(userId).then(() => { - logger.info('profileDataChanged:cacheCleared', { uid: userId }); + logger.info('profileDataChange:cacheCleared', { uid: userId }); }); }) .then(function () { @@ -78,8 +78,8 @@ module.exports = function (server) { return deleteUser(message); case 'primaryEmailChanged': return primaryEmailChanged(message); - case 'profileDataChanged': - return profileDataChanged(message); + case 'profileDataChange': + return profileDataChange(message); default: return; } diff --git a/packages/fxa-profile-server/test/events.js b/packages/fxa-profile-server/test/events.js index d912e5d23a..c7bf9a8f8e 100644 --- a/packages/fxa-profile-server/test/events.js +++ b/packages/fxa-profile-server/test/events.js @@ -227,7 +227,7 @@ describe('#integration - events', function () { function Message(type, onDel) { if (typeof type === 'function') { onDel = type; - type = 'profileDataChanged'; + type = 'profileDataChange'; } return { event: type, @@ -259,7 +259,7 @@ describe('#integration - events', function () { function Message(type, onDel) { if (typeof type === 'function') { onDel = type; - type = 'profileDataChanged'; + type = 'profileDataChange'; } return { event: type,