Store prev response uids in usedUids

This commit is contained in:
Ivana 2020-12-15 12:20:14 +01:00
parent 5a718f091b
commit 05c496e2a8

View File

@ -130,8 +130,11 @@ export function appendResponseToBufferedData(response: LokiTailResponse, data: M
const labelsField = data.fields[3];
const idField = data.fields[4];
// We need to store and track all used uids to ensure that uids are unique
const usedUids: { string?: number } = {};
// We need to store and track all used uids (from current response, but also data) to ensure that uids are unique
const usedUids: { string?: number } = idField.values.toArray().reduce((obj, uid) => {
obj[uid] = 0;
return obj;
}, {});
for (const stream of streams) {
// Find unique labels