fix(session): poll sidebar session list to surface externally created sessions#1551
Closed
Formatted wants to merge 1 commit intodifferent-ai:devfrom
Closed
fix(session): poll sidebar session list to surface externally created sessions#1551Formatted wants to merge 1 commit intodifferent-ai:devfrom
Formatted wants to merge 1 commit intodifferent-ai:devfrom
Conversation
… sessions Automated runs, messaging bot sessions, and other externally created sessions were invisible in the sidebar until the user triggered an indirect refresh (e.g. renaming a session). Add a lightweight 30s polling interval that calls refreshRouteState() when the tab is visible. The existing refreshInFlightRef guard prevents overlapping calls. Fixes different-ai#1262
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
@Formatted is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Collaborator
|
we're moving more to query caching, and having an interval in a useEffect is generally not great practice |
Formatted
added a commit
to Formatted/openwork
that referenced
this pull request
Apr 28, 2026
…ternally created sessions Automated runs, messaging bot sessions (Slack/Telegram), and other externally created sessions were invisible in the sidebar until the user triggered an indirect refresh (e.g. renaming a session). Replaces the closed useEffect+setInterval approach (PR different-ai#1551) with a visibility-aware polling hook backed by TanStack Query caching: - New session-list-cache.ts module with query key factory and useSessionListPolling hook - Session lists written to TanStack Query cache alongside imperative state - Lightweight refreshSessionLists callback avoids heavy refreshRouteState work - Existing refreshInFlightRef dedup guard prevents overlapping calls - Only fires when tab is visible; also fires immediately on visibility change Fixes different-ai#1262
Author
|
Hi @src-opn — thanks for the feedback. I've opened a replacement PR #1584 that addresses the query caching concern:
Let me know if this approach works better! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
refreshInFlightRefguard prevents overlapping calls, so this does not interfere with user-triggered refreshesdocument.visibilityState === "visible"to avoid unnecessary network requestsProblem
Automated runs, messaging bot sessions (Slack/Telegram), and other externally created sessions were invisible in the sidebar until the user triggered an indirect refresh (e.g. renaming a session). This is because
refreshRouteState()was only called on explicit user actions and visibility change events, with no periodic refresh mechanism.Solution
Added a lightweight
useEffectinsession-route.tsxthat callsrefreshRouteState()every 30 seconds when the tab is visible. The existing dedup guard inrefreshRouteStateensures overlapping calls are skipped, so this integrates safely with all existing refresh paths.Files Changed
apps/app/src/react-app/shell/session-route.tsx— added periodic pollinguseEffectIssue
Fixes #1262