Add debugging console

This commit is contained in:
2026-03-07 21:59:39 +01:00
parent 66246e4e16
commit 90f067e662
49 changed files with 5962 additions and 139 deletions

View File

@@ -11,6 +11,7 @@ import { WebRTCService } from './webrtc.service';
import { Store } from '@ngrx/store';
import { selectCurrentRoomName } from '../../store/rooms/rooms.selectors';
import { DatabaseService } from './database.service';
import { recordDebugNetworkFileChunk } from './debug-network-metrics.service';
/** Size (bytes) of each chunk when streaming a file over RTCDataChannel. */
const FILE_CHUNK_SIZE_BYTES = 64 * 1024; // 64 KB
@@ -400,7 +401,7 @@ export class AttachmentService {
* assembled into a Blob and an object URL is created.
*/
handleFileChunk(payload: any): void {
const { messageId, fileId, index, total, data } = payload;
const { messageId, fileId, fromPeerId, index, total, data } = payload;
if (
!messageId || !fileId ||
@@ -444,6 +445,9 @@ export class AttachmentService {
attachment.receivedBytes = previousReceived + decodedBytes.byteLength;
if (fromPeerId)
recordDebugNetworkFileChunk(fromPeerId, decodedBytes.byteLength, now);
if (!attachment.startedAtMs)
attachment.startedAtMs = now;