Skip to content

Commit 4e97968

Browse files
committed
remove duplicate entries if the same entity is used for two traces.
1 parent 55fb491 commit 4e97968

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Cache.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export default class Cache {
176176
h = h.filter(
177177
(x, i) => i == 0 || i == h.length - 1 || !x.duplicate_datapoint
178178
);
179+
h = h.filter((_, i) => h[i].last_changed !== h[i + 1]?.last_changed);
179180
this.histories[entityId] = h;
180181
this.attributes[entityId] = fetchedHistory.attributes;
181182
this.ranges[entityId].push(fetchedHistory.range);

0 commit comments

Comments
 (0)