Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: add an additional 'final unloading' page exist observable #1830

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

janeklb
Copy link

@janeklb janeklb commented Nov 18, 2022

Motivation

Any data sent by clients from their own registered beforeunload listeners will not make it into the intake because this library's beforeunload listener is registered first and therefore executes first.

Changes

Send an additional page exit event (with a new reason: 'final_before_unload') from a setTimeout(..., 0) (seems like the best option since process.nextTick is not available in browsers, and setImmediate is not widely available in browers either).

This will result is a "best effort" of sending more data, but it's still possible to not catch everything

Testing

Not done any yet -- this is just a proposal

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

Motivation:
Any data sent by clients from their own registered `beforeunload`
listeners will not make it into the intake because this library's
`beforeunload` listener is registered first and therefore executes
first.

Proposal:
Send an additional page exit event (with a new reason:
'final_before_unload') from a `setTimeout(..., 0)` (seems like the best
option since `process.nextTick` is not available in browsers, and
`setImmediate` is not widely available in browers either).

This will result is a "best effort" of sending more data, but it's still
possible to not catch everything
@janeklb janeklb requested a review from a team as a code owner November 18, 2022 12:03
@bits-bot
Copy link

bits-bot commented Nov 18, 2022

CLA assistant check
All committers have signed the CLA.

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.

None yet

2 participants