Skip to content

Conversation

r0b1n
Copy link
Collaborator

@r0b1n r0b1n commented Oct 14, 2025

Pull request type

Bug fix (non-breaking change which fixes an issue)


Description

There are two major issues addressed in this change

  • First is burst execution of events in inactive tabs, due to throttled timers. This change prevents them from piling up and executing all at once. This is kinda hard to test I think, because the conditions when throttling actually happens are unclear.

  • Second and is likely the original cause of the issue is that the microflow took more than 1 second to finish but the event timer didn't account for that, it was not checking that previous run is not yet finished and didn't account for that, making it a race condition in the microflow which gave the original symptoms - multiple popups.

What to test

  • Test that original issue is not happening. Trying to reproduce true bursting in inactive tabs can be challenging I think, but from my understanding it is not the original cause per se. I reproduced the original issue by just lowering the timer to 300 ms and this started to happen in non-inactive tabs as well.
  • Test that attribute listening functionality is still working as this was rewritten as well.

@r0b1n r0b1n requested a review from a team as a code owner October 14, 2025 16:02
@r0b1n r0b1n changed the title chore: improve events timer [WC-3107] Prevent burst execution in Events widget Oct 15, 2025
@r0b1n r0b1n force-pushed the events-timer-improvement branch from 0a417cc to c4fccfa Compare October 15, 2025 10:54
}

stop(): void {
window.clearTimeout(this.intervalHandle);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using window will always causing problems if apps is being put inside iframe.

maybe pass ref from wrapper div, and ref.current.ownerDocument.defaultView

@r0b1n r0b1n force-pushed the events-timer-improvement branch from c4fccfa to 14e2de9 Compare October 15, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants