diff --git a/plugin-server/src/main/ingestion-queues/session-recording/services/session-manager-v3.ts b/plugin-server/src/main/ingestion-queues/session-recording/services/session-manager-v3.ts index 49d9001f86de2..cac6cad613e58 100644 --- a/plugin-server/src/main/ingestion-queues/session-recording/services/session-manager-v3.ts +++ b/plugin-server/src/main/ingestion-queues/session-recording/services/session-manager-v3.ts @@ -136,6 +136,10 @@ export class SessionManagerV3 { context: bufferMetadata, fileStream: manager.createFileStreamFor(path.join(context.dir, BUFFER_FILE_NAME)), } + + // TODO: Flush the file here as appending to a gzipped file doesn't seem to work + + await manager.markCurrentBufferForFlush('rebalance') } catch (error) { // Indicates no buffer metadata file or it's corrupted status.error('🧨', '[session-manager] failed to read buffer metadata', { @@ -269,7 +273,7 @@ export class SessionManagerV3 { await this.flushFiles() } - private async markCurrentBufferForFlush(reason: 'buffer_size' | 'buffer_age'): Promise { + private async markCurrentBufferForFlush(reason: 'buffer_size' | 'buffer_age' | 'rebalance'): Promise { const buffer = this.buffer if (!buffer) { // TODO: maybe error properly here?