Skip to content

Conversation

raju-opti
Copy link
Contributor

Summary

Currently, in browser, when the page is unloaded, the sdk instance is being closed in order to flush pending events. But when the page is loaded from bfcache, the sdk instance stays closed as bfcache restores the Javascript heap as well, which causes further events to be not processed.

This PR updates the code to flush events on page unload without closing the sdk instance.

Test plan

  • added tests

Issues

@coveralls
Copy link

coveralls commented Oct 6, 2025

Coverage Status

coverage: 78.76% (-0.2%) from 78.946%
when pulling 4fafcdc on raju/flushImmediate
into ccd6adb on master.

Copy link
Contributor

@junaed-optimizely junaed-optimizely left a comment

Choose a reason for hiding this comment

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

Looks solid!

@raju-opti raju-opti force-pushed the raju/flushImmediate branch from d9934f7 to 4fafcdc Compare October 6, 2025 19:19
@raju-opti raju-opti merged commit 99a4ca7 into master Oct 7, 2025
14 of 19 checks passed
@raju-opti raju-opti deleted the raju/flushImmediate branch October 7, 2025 14:25
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.

3 participants