TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
973 stars 304 forks source link

Event list does not account for multiple events with same name and timestamp #3098

Closed kschiffer closed 4 years ago

kschiffer commented 4 years ago

Summary

The event list component is prone to same key warnings, happening when occasionally multiple events with the same name and timestamps are generated.

Steps to Reproduce

  1. Go to gateway events (it's likelier to happen here but this can happen also for applicaiton/end device events)
  2. Wait for some events to arrive
  3. Eventually, see a duplicate key warning in the logs

What do you see now?

react-dom.development.js?7f13:546 Warning: Encountered two children with the same key, `2020-08-18T15:25:49.148698549Z-gs.status.forward`.

What do you want to see instead?

Event keys being composed in a way that is sufficiently unique.

Environment

v3.9.0

How do you propose to implement this?

We need to find a way to derive a truly UID from the event content. If some events are actually identical then this will be impossible, but on the other hand raises the question of why such events exist in the first place

How do you propose to test this?

Manual.

Can you do this yourself and submit a Pull Request?

Yes. I'll fix this as part of my work on #2826

bafonins commented 4 years ago

References https://github.com/TheThingsNetwork/lorawan-stack/issues/580