Files
cinny/src/app/state/debugPackets.ts
T
litruv 230ca4fcf0
Checks / checks (push) Successful in 2m14s
Trigger cinny-mobile / dispatch (push) Successful in 1s
Add the debug packet recorder behind the developer-tools toggle.
2026-11-01 09:01:38 +11:00

26 lines
532 B
TypeScript

export interface DebugPacket {
id: number;
ts: number;
phase: 'start' | 'end';
method: string;
url: string;
path: string;
status?: number;
ms?: number;
txnId?: string;
eventId?: string;
req?: string;
res?: string;
error?: string;
}
let nextId = 0;
export function recordPacket(packet: Omit<DebugPacket, 'id'>) {
const full: DebugPacket = { id: nextId, ...packet };
nextId += 1;
// Web and mobile builds have no electron bridge, so nothing is recorded there
window.electron?.debug?.send(full);
}