Skip to content

Commit

Permalink
fix v3 consumer to ignore ingestion warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Mar 19, 2024
1 parent 6db56b8 commit 9970346
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export class SessionRecordingIngesterV3 {
*/
this.promises.add(promise)

// eslint-disable-next-line @typescript-eslint/no-floating-promises
promise.finally(() => this.promises.delete(promise))

Check failure on line 139 in plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer-v3.ts

View workflow job for this annotation

GitHub Actions / Code quality

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

return promise
Expand Down Expand Up @@ -191,11 +190,15 @@ export class SessionRecordingIngesterV3 {
for (const message of messages) {
counterKafkaMessageReceived.inc({ partition: message.partition })

const recordingMessage = await parseKafkaMessage(message, (token) =>
this.teamsRefresher.get().then((teams) => ({
teamId: teams[token]?.teamId || null,
consoleLogIngestionEnabled: teams[token]?.consoleLogIngestionEnabled ?? true,
}))
const recordingMessage = await parseKafkaMessage(
message,
(token) =>
this.teamsRefresher.get().then((teams) => ({
teamId: teams[token]?.teamId || null,
consoleLogIngestionEnabled: teams[token]?.consoleLogIngestionEnabled ?? true,
})),
// v3 consumer does not emit ingestion warnings
undefined
)

if (recordingMessage) {
Expand Down Expand Up @@ -456,7 +459,7 @@ export class SessionRecordingIngesterV3 {
}

private setupHttpRoutes() {
// Mimic the app sever's endpoint
// Mimic the app server's endpoint
expressApp.get('/api/projects/:projectId/session_recordings/:sessionId/snapshots', async (req, res) => {
await runInstrumentedFunction({
statsKey: `recordingingester.http.getSnapshots`,
Expand Down

0 comments on commit 9970346

Please sign in to comment.