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

What is the expected behaviour when a user closes the tab before the service worker completes a task? #503

Open
edwardmyung opened this issue Nov 24, 2023 · 0 comments

Comments

@edwardmyung
Copy link

edwardmyung commented Nov 24, 2023

Background

I have setup Partytown to handle logging with Datadog, and calls to the logger e.g. DD_LOGS.logger.info('some log') currently do process successfully off the main thread.

However, I'm finding that:

  1. if I trigger the logger on the main thread, then close the tab shortly after, the log doesn't appear
  2. if I trigger the logger on the main thread, the network call (from the service-worker) to datadog seems to take a long time, often >10 seconds

Questions

When partytown is setup correctly:

  1. Should the service worker stay alive to complete the task, or is it expected that this function call won't succeed if the tab is closed before the service-worker completes the network call for the log?
  2. Should the delay to process the event in the service-worker be so long (>10 seconds)?

Thanks

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

No branches or pull requests

1 participant