diff --git a/apps/photos/src/services/entityService.ts b/apps/photos/src/services/entityService.ts index 8b6f47ba8..b93eb6181 100644 --- a/apps/photos/src/services/entityService.ts +++ b/apps/photos/src/services/entityService.ts @@ -14,6 +14,7 @@ import { EncryptedEntity, } from 'types/entity'; import { getLatestVersionEntities } from 'utils/entity'; +import { addLogLine } from 'utils/logging'; const ENDPOINT = getEndpoint(); @@ -105,10 +106,14 @@ export const syncEntities = async () => { } }; -const syncEntity = async (type: EntityType): Promise> => { +const syncEntity = async (type: EntityType): Promise => { try { - let entities = await getLocalEntity(type); + let entities = await getLocalEntity(type); + addLogLine( + `Syncing ${type} entities localEntitiesCount: ${entities.length}` + ); let syncTime = await getEntityLastSyncTime(type); + addLogLine(`Syncing ${type} entities syncTime: ${syncTime}`); let response: EntitySyncDiffResponse; do { response = await getEntityDiff(type, syncTime); @@ -152,6 +157,9 @@ const syncEntity = async (type: EntityType): Promise> => { } await localForage.setItem(ENTITY_TABLES[type], nonDeletedEntities); await localForage.setItem(ENTITY_SYNC_TIME_TABLES[type], syncTime); + addLogLine( + `Syncing ${type} entities nonDeletedEntitiesCount: ${nonDeletedEntities.length}` + ); } while (response.hasMore); } catch (e) { logError(e, 'Sync entity failed');