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

fix: Keep connection open when navigating away from tab #29231

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

timgl
Copy link
Collaborator

@timgl timgl commented Feb 26, 2025

Problem

Changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

@timgl timgl merged commit c009101 into master Feb 26, 2025
15 of 17 checks passed
@posthog-bot
Copy link
Contributor

Hey @timgl! 👋
This pull request seems to contain no description. Please add useful context, rationale, and/or any other information that will help make sense of this change now and in the distant Mars-based future.

@timgl timgl deleted the keep-query-awaited-connection-open branch February 26, 2025 02:20
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds the openWhenHidden: true option to the fetchEventSource configuration in the query execution logic, ensuring connections remain open when users navigate away from the tab.

  • Modified frontend/src/queries/query.ts to prevent browser suspension of long-running query connections when tabs are inactive
  • This fix is particularly important for data-intensive operations like SQL queries and session recordings that use streaming connections
  • Prevents unnecessary query timeouts and failures when users multitask across browser tabs
  • Improves reliability for queries that take longer to complete, especially in complex analytics scenarios

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

Size Change: 0 B

Total Size: 9.72 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 9.72 MB

compressed-size-action

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