mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 04:18:05 +00:00
fix(ui): include stage in leaf coalesce key
PR-Agent flagged that the leaf coalesceKey omitted `stage`, so two adjacent no-requestId logs differing only by stage (e.g. one logging `route` and the next `dispatch`) would merge into a single `×2` row, hiding a distinct entry. Add `stage` to the coalesce tuple. New unit test asserts that two leaves identical except for stage stay as separate rows. Refs #1138, #1151
This commit is contained in:
@@ -33,6 +33,7 @@ function coalesceKey(entry: LogsEntry): string {
|
||||
return [
|
||||
entry.event ?? '',
|
||||
entry.message ?? '',
|
||||
entry.stage ?? '',
|
||||
entry.module ?? entry.source ?? '',
|
||||
entry.level,
|
||||
entry.requestId ?? '',
|
||||
|
||||
@@ -119,6 +119,17 @@ describe('deriveTraceGroups', () => {
|
||||
expect(leaves.every((l) => l.repeatCount === undefined)).toBe(true);
|
||||
});
|
||||
|
||||
it('keeps adjacent leaves with different stages as separate rows (round-6 fix)', () => {
|
||||
const result = deriveTraceGroups(
|
||||
leafEntries(
|
||||
{ id: '1', timestamp: 't1', event: 'e', message: 'm', stage: 'route' },
|
||||
{ id: '2', timestamp: 't2', event: 'e', message: 'm', stage: 'dispatch' }
|
||||
)
|
||||
);
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result.every((r) => r.kind === 'leaf' && r.repeatCount === undefined)).toBe(true);
|
||||
});
|
||||
|
||||
it('keeps adjacent leaves with different messages as separate rows', () => {
|
||||
const result = deriveTraceGroups(
|
||||
leafEntries(
|
||||
|
||||
Reference in New Issue
Block a user