Files
rrweb/src
Eoghan Murray cfe59cb4b4 Sort events upon creation, and keep ordered (#411)
* Sort events at start, as otherwise we risk misidentifying the last event

* Keep inserted events in the correct order, ensuring we don't misidentify the last event

 - e.g. network conditions mean that 'live' events come in non-sequentially
 - or so that adding custom events to an existing event works

* Ensure we maintain original ordering while inserting a new event which has an identical timestamp to an existing event. This came up with a series of mutations which had the same timestamp but needed to be applied in the correct order

* Fast track the common case of a new event being added which occurs after all prior events
2026-04-01 12:00:00 +08:00
..
2026-04-01 12:00:00 +08:00
2026-04-01 12:00:00 +08:00
2026-04-01 12:00:00 +08:00