Skip to content

Commit

Permalink
Merge pull request #300 from guardian/avatar-URL-discrepancies
Browse files Browse the repository at this point in the history
remove avatar URL discrepancy detection (since it's arguably more wasteful than just updating the DB records)
  • Loading branch information
twrichards authored Dec 18, 2023
2 parents 61775e6 + a5370da commit 04e9003
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
31 changes: 0 additions & 31 deletions users-refresher-lambda/src/google/isDefinitelyDifferentAvatar.ts

This file was deleted.

7 changes: 1 addition & 6 deletions users-refresher-lambda/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
import { buildUserLookupFromDatabase } from "./google/buildUserLookupFromDatabase";
import { getGroupMembersFromGoogle } from "./google/getGroupMembersFromGoogle";
import { getGroupDetailFromGoogle } from "./google/getGroupDetailFromGoogle";
import { isDefinitelyDifferentAvatar } from "./google/isDefinitelyDifferentAvatar";

const s3 = new S3(standardAwsConfig);

Expand Down Expand Up @@ -146,11 +145,7 @@ export const handler = async ({
maybeUserFromDatabase.firstName !== maybeUserFromGoogle.firstName ||
maybeUserFromDatabase.lastName !== maybeUserFromGoogle.lastName ||
maybeUserFromDatabase.googleID !== maybeUserFromGoogle.googleID ||
(await isDefinitelyDifferentAvatar(
email,
maybeUserFromDatabase.avatarUrl,
maybeAvatarUrl
))
maybeUserFromDatabase.avatarUrl !== maybeAvatarUrl // annoyingly these URLs often differ despite the image not changing - thanks Google!!
) {
console.log(`Updating details for user ${email}`);
await sql`
Expand Down

0 comments on commit 04e9003

Please sign in to comment.