This repository was archived by the owner on Mar 24, 2026. It is now read-only.
forked from Synapsr/Vexa-Dashboard
-
Notifications
You must be signed in to change notification settings - Fork 9
refactor: move decision listener URL from build-time env var to runtime config #6
Open
agrogov
wants to merge
1
commit into
Vexa-ai:llm-listener
Choose a base branch
from
agrogov:decision-listener-url-runtime-config
base: llm-listener
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ import { Badge } from "@/components/ui/badge"; | |
| import { Textarea } from "@/components/ui/textarea"; | ||
| import { Separator } from "@/components/ui/separator"; | ||
| import { toast } from "sonner"; | ||
| import { useRuntimeConfig } from "@/hooks/use-runtime-config"; | ||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| // ──────────────────────────────────────────────────────────────────────────── | ||
|
|
@@ -51,9 +52,6 @@ export interface DecisionItem { | |
| // Helpers | ||
| // ──────────────────────────────────────────────────────────────────────────── | ||
|
|
||
| const DECISION_LISTENER_URL = | ||
| process.env.NEXT_PUBLIC_DECISION_LISTENER_URL ?? "http://localhost:8765"; | ||
|
|
||
| function uid() { | ||
| return Math.random().toString(36).slice(2) + Date.now().toString(36); | ||
| } | ||
|
|
@@ -378,6 +376,8 @@ interface DecisionsPanelProps { | |
| } | ||
|
|
||
| export function DecisionsPanel({ meetingId, isActive, embedded }: DecisionsPanelProps) { | ||
| const { config } = useRuntimeConfig(); | ||
| const decisionListenerUrl = config?.decisionListenerUrl ?? "http://localhost:8765"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because Useful? React with 👍 / 👎. |
||
| const [items, setItems] = useState<DecisionItem[]>([]); | ||
| const [isCollapsed, setIsCollapsed] = useState(false); | ||
| const [connected, setConnected] = useState(false); | ||
|
|
@@ -390,7 +390,7 @@ export function DecisionsPanel({ meetingId, isActive, embedded }: DecisionsPanel | |
|
|
||
| const connectSSE = useCallback(() => { | ||
| if (esRef.current) return; // already connected | ||
| const url = `${DECISION_LISTENER_URL}/decisions/${meetingId}`; | ||
| const url = `${decisionListenerUrl}/decisions/${meetingId}`; | ||
| const es = new EventSource(url); | ||
| esRef.current = es; | ||
|
|
||
|
|
@@ -444,7 +444,7 @@ export function DecisionsPanel({ meetingId, isActive, embedded }: DecisionsPanel | |
| if (isActive) connectSSE(); | ||
| }, 5000); | ||
| }; | ||
| }, [meetingId, isActive]); | ||
| }, [decisionListenerUrl, meetingId, isActive]); | ||
|
|
||
| useEffect(() => { | ||
| if (!isActive) return; | ||
|
|
@@ -461,7 +461,7 @@ export function DecisionsPanel({ meetingId, isActive, embedded }: DecisionsPanel | |
| const load = async () => { | ||
| try { | ||
| const res = await fetch( | ||
| `${DECISION_LISTENER_URL}/decisions/${meetingId}/all` | ||
| `${decisionListenerUrl}/decisions/${meetingId}/all` | ||
| ); | ||
| if (!res.ok) return; | ||
| const data = await res.json(); | ||
|
|
@@ -488,7 +488,7 @@ export function DecisionsPanel({ meetingId, isActive, embedded }: DecisionsPanel | |
| } | ||
| }; | ||
| load(); | ||
| }, [meetingId]); | ||
| }, [decisionListenerUrl, meetingId]); | ||
|
|
||
| // ── Item actions ───────────────────────────────────────────────────────── | ||
|
|
||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fallback causes
MeetingAnthologyto hithttp://localhost:8765during the first render while runtime config is still loading, and its effects then start/decisions/.../all, SSE, and summary traffic against that wrong host before switching later. When the configured listener URL differs from localhost, this creates deterministic bad requests and transiently incorrect/empty data; the effects should wait until runtime config is resolved.Useful? React with 👍 / 👎.