Improvements to shared library components

This commit is contained in:
Josh Perez 2021-07-21 16:45:41 -04:00 committed by GitHub
parent 2c59c71872
commit d9e90e9ea8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 485 additions and 348 deletions

View file

@ -15,6 +15,8 @@ import { take } from './util/iterables';
import { isOlderThan } from './util/timestamp';
import { ConversationModel } from './models/conversations';
import { StorageInterface } from './types/Storage.d';
// Imported this way so that sinon.sandbox can stub this properly
import * as profileGetter from './util/getProfile';
const STORAGE_KEY = 'lastAttemptedToRefreshProfilesAt';
const MAX_AGE_TO_BE_CONSIDERED_ACTIVE = 30 * 24 * 60 * 60 * 1000;
@ -60,7 +62,7 @@ export async function routineProfileRefresh({
totalCount += 1;
try {
await conversation.getProfile(
await profileGetter.getProfile(
conversation.get('uuid'),
conversation.get('e164')
);