fix(qlog): mark non-string frame types incomplete (#9433)

* fix(qlog): mark non-string frame types incomplete

* test(ghidra): assert current provider limitations
This commit is contained in:
ShuaixinHuang authored and GitHub committed 2026-11-08 21:50:33 +00:00
1 parent c0c6488ae9
commit d0fd1b05fc
2 files changed
+16 -5

No files matched your search

+15
View File
@@ -134,6 +134,21 @@ it("keeps incomplete fields unknown and FIN without bytes as metadata", () => {
expect(traces[0]?.loss_declarations[0]?.packet_number.state).toBe("unknown");
});
it("marks non-string frame types incomplete without hiding their recorded values", () => {
const { decoded, traces } = facts(
capture([
event([{ frame_type: 0 }, frame(0, 5)]),
event([{ frame_type: false }], "transport:packet_received"),
event([{ frame_type: "extension:custom" }]),
]),
);
expect(traces[0]?.incomplete_fact_records).toEqual([0, 1]);
expect(traces[0]?.streams[0]?.unique_bytes).toBe("5");
expect(decoded.records[0]?.reported).toMatchObject({
data: { frames: [{ frame_type: 0 }, frame(0, 5)] },
});
});
it.each([
{ fin: undefined, incomplete: [0] },
{ fin: null, incomplete: [0] },
+1 -5
View File
@@ -264,11 +264,7 @@ const collectTransportFacts = (
return;
}
for (const [frameIndex, frame] of data.frames.entries()) {
if (
!object(frame) ||
frame.frame_type === undefined ||
frame.frame_type === null
) {
if (!object(frame) || typeof frame.frame_type !== "string") {
fact.incomplete_fact_records.push(ordinal);
continue;
}