Fix duplicate EventListSummarys (#7952)

* Fix duplicate EventListSummarys

Signed-off-by: Robin Townsend <robin@robin.town>

* Add regression test

Signed-off-by: Robin Townsend <robin@robin.town>
This commit is contained in:
Robin 2022-03-02 11:46:51 -05:00 committed by GitHub
parent 560f8f7ee7
commit aadb64615f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 6 deletions

View file

@ -1290,12 +1290,11 @@ class MainGrouper extends BaseGrouper {
const keyEvent = this.events.find(e => this.panel.grouperKeyMap.get(e));
const key = keyEvent ? this.panel.grouperKeyMap.get(keyEvent) : this.generateKey();
if (!keyEvent) {
// Populate the weak map with the key that we are using for all related events.
this.events.forEach(e => {
if (!this.panel.grouperKeyMap.has(e)) {
this.panel.grouperKeyMap.set(e, key);
}
});
// Populate the weak map with the key.
// Note that we only set the key on the specific event it refers to, since this group might get
// split up in the future by other intervening events. If we were to set the key on all events
// currently in the group, we would risk later giving the same key to multiple groups.
this.panel.grouperKeyMap.set(this.events[0], key);
}
let highlightInSummary = false;