rrweb-io / rrweb

record and replay the web
https://www.rrweb.io/
MIT License
15.9k stars 1.38k forks source link

[Bug]: progress bar not updating when adding event asynchronously using addEvent #1492

Open ShayMalchi opened 1 month ago

ShayMalchi commented 1 month ago

Preflight Checklist

What package is this bug report for?

rrweb

Version

^2.0.0-alpha.11

Expected Behavior

Seeing the progress bar getting compacted (specifically inactive time) as duration grows, as well as custom events in the right timing.

Actual Behavior

calling addEvent updates the duration, but not redraws the progress bar. The progress bar drawing remains like the original, specifically inactive time doesn't "compress" as it should and custom events are not showing on the right place in the bar.

Steps to Reproduce

  1. Init a player using new rrwebPlayer(...) (with or without liveMode, didn't see the difference)
  2. add events asynchronously after some time.
  3. See the progress bar hasn't updated, but duration did.
  4. do a full reload and see the progress bar is updated.

Testcase Gist URL

No response

Additional Information

No response