diff --git a/src/course/handlers/sync-assessment-events-handler.ts b/src/course/handlers/sync-assessment-events-handler.ts index 939881f1b..b0d7b7882 100644 --- a/src/course/handlers/sync-assessment-events-handler.ts +++ b/src/course/handlers/sync-assessment-events-handler.ts @@ -66,7 +66,7 @@ export class SyncAssessmentEventsHandler { const context = JSON.parse(key); this.capturedAssessmentEvents[key]!.forEach((event) => { if (context.batchStatus !== 2) { - this.persistAssessEvent(event, context); + this.persistAssessEvent(event, context).toPromise(); } }); }); @@ -193,7 +193,7 @@ export class SyncAssessmentEventsHandler { return this.invokeSyncApi(assessmentTelemetrySyncRequest); }), tap(async () => - await this.dbService.execute(`DELETE FROM ${CourseAssessmentEntry.TABLE_NAME}`) + await this.dbService.execute(`DELETE FROM ${CourseAssessmentEntry.TABLE_NAME}`).toPromise() ), mapTo(undefined) ).toPromise(); diff --git a/src/summarizer/handler/summary-telemetry-event-handler.ts b/src/summarizer/handler/summary-telemetry-event-handler.ts index e31be8cfb..cfeac51c1 100644 --- a/src/summarizer/handler/summary-telemetry-event-handler.ts +++ b/src/summarizer/handler/summary-telemetry-event-handler.ts @@ -18,7 +18,7 @@ import {ContentAccess, ContentAccessStatus, ProfileService} from '../../profile' import {ArrayUtil} from '../../util/array-util'; import {DbService} from '../../db'; import {Observable, of} from 'rxjs'; -import {map, mapTo, mergeMap, tap} from 'rxjs/operators'; +import {map, mapTo, mergeMap, tap, delay} from 'rxjs/operators'; export class SummaryTelemetryEventHandler implements ApiRequestHandler { private static readonly CONTENT_PLAYER_PID = 'contentplayer'; @@ -142,6 +142,7 @@ export class SummaryTelemetryEventHandler implements ApiRequestHandler { const playerSummary: Array = event.edata['summary']; const contentMimeType = content.mimeType;