Skip to content

Commit adf1d06

Browse files
authored
refactor: avoid duplicate packet metadata (#445)
1 parent f926d2c commit adf1d06

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

src/__tests__/observability.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ test('public observability parser preserves Android packet IDs', () => {
7575

7676
assert.equal(dump.entries.length, 1);
7777
assert.equal(dump.entries[0]?.packetId, '23911610');
78-
assert.equal(dump.entries[0]?.metadata?.packetId, '23911610');
78+
assert.equal(dump.entries[0]?.metadata?.packetId, undefined);
7979
});
8080

8181
test('public observability merge de-duplicates entries and honors max entries', () => {
@@ -106,7 +106,6 @@ test('public observability mapper produces backend diagnostics result', () => {
106106
dump.entries[0] = {
107107
...dump.entries[0],
108108
packetId: 'packet-1',
109-
metadata: { packetId: 'packet-1' },
110109
};
111110

112111
const result = mapNetworkDumpToBackendResult(dump, {

src/observability.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ function toParsedNetworkDump(
135135
...(entry.responseBody !== undefined ? { responseBody: entry.responseBody } : {}),
136136
...(entry.raw ? { raw: entry.raw } : {}),
137137
...(entry.line !== undefined ? { line: entry.line } : {}),
138-
...(entry.packetId
139-
? { packetId: entry.packetId, metadata: { packetId: entry.packetId } }
140-
: {}),
138+
...(entry.packetId ? { packetId: entry.packetId } : {}),
141139
})),
142140
include: dump.include,
143141
limits: dump.limits,

0 commit comments

Comments
 (0)