[FSSDK-11879] flush events without closing client on page unload by raju-opti · Pull Request #1087 · optimizely/javascript-sdk

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