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

remove avatar URL discrepancy detection (since it's arguably more wasteful than just updating the DB records) #300

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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