-
-
Notifications
You must be signed in to change notification settings - Fork 196
Opponent video stream fix #413
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,10 @@ interface DebatePopupProps { | |
| onClose: () => void; | ||
| } | ||
|
|
||
| const baseURL = ( | ||
| import.meta.env.VITE_BASE_URL || 'http://localhost:1313' | ||
| ).replace(/\/+$/, ''); | ||
|
Comment on lines
+11
to
+13
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
'VITE_BASE_URL|import\.meta\.env\.VITE_BASE_URL' .Repository: AOSSIE-Org/DebateAI Length of output: 3020 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- candidate files ---'
git ls-files 'frontend/src/components/DebatePopup.tsx' 'frontend/src/components/RoomBrowser.tsx' \
'frontend/src/Pages/OnlineDebateRoom.tsx' 'frontend/src/Pages/TeamDebateRoom.tsx' \
'frontend/src/services/teamDebateService.ts' 'frontend/src/services/gamificationService.ts'
printf '%s\n' '--- relevant declarations and imports ---'
rg -n -C 3 'baseURL|BASE_URL|baseUrl|VITE_BASE_URL|window\.location\.origin|from .*(config|url|api)' \
frontend/src/components/DebatePopup.tsx \
frontend/src/components/RoomBrowser.tsx \
frontend/src/Pages/OnlineDebateRoom.tsx \
frontend/src/Pages/TeamDebateRoom.tsx \
frontend/src/services/teamDebateService.ts \
frontend/src/services/gamificationService.ts
printf '%s\n' '--- possible shared helpers ---'
rg -n --glob '!node_modules' --glob '!dist' --glob '!build' \
'get.*(URL|Url)|API_BASE_URL|BASE_URL|location\.origin|VITE_' frontend/srcRepository: AOSSIE-Org/DebateAI Length of output: 24227 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- target source ---'
sed -n '1,90p' frontend/src/components/DebatePopup.tsx
sed -n '1,95p' frontend/src/components/RoomBrowser.tsx
printf '%s\n' '--- deployment and build configuration ---'
git ls-files | rg '(^|/)(Dockerfile[^/]*|docker-compose[^/]*|vite\.config\.[^/]*|package\.json|\.env[^/]*|README\.md|nginx[^/]*)$' | sort
rg -n -C 3 'VITE_BASE_URL|localhost:1313|window\.location\.origin|production|build|proxy' \
README.md .env.example docker-compose.yml frontend/package.json frontend/vite.config.* 2>/dev/null || true
printf '%s\n' '--- frontend source helper candidates ---'
git ls-files frontend/src | rg -i '(config|constant|url|api|env|helper|util|service)' | sort
rg -n --glob '*.ts' --glob '*.tsx' \
'export (const|function)|export default|VITE_BASE_URL|window\.location\.origin' frontend/src \
| sed -n '1,240p'
printf '%s\n' '--- deterministic fallback behavior ---'
python3 - <<'PY'
values = [None, '', ' ', 'https://api.example.test///']
for value in values:
# Models the exact JavaScript `||` behavior for the relevant string inputs.
selected = value or 'http://localhost:1313'
normalized = selected.rstrip('/')
print(f'{value!r} -> {normalized!r}')
PYRepository: AOSSIE-Org/DebateAI Length of output: 24581 Use a shared API URL configuration When 📍 Affects 2 files
🤖 Prompt for AI Agents |
||
|
|
||
| const DebatePopup: React.FC<DebatePopupProps> = ({ onClose }) => { | ||
| const navigate = useNavigate(); | ||
| const [roomCode, setRoomCode] = useState(''); | ||
|
|
@@ -26,9 +30,6 @@ const DebatePopup: React.FC<DebatePopupProps> = ({ onClose }) => { | |
| return; | ||
| } | ||
|
|
||
| const baseURL = | ||
| import.meta.env.VITE_BASE_URL || 'http://localhost:1313'; | ||
|
|
||
| try { | ||
| const response = await fetch( | ||
| `${baseURL}/rooms/${encodeURIComponent(trimmedRoomCode)}/join`, | ||
|
|
@@ -59,7 +60,7 @@ const DebatePopup: React.FC<DebatePopupProps> = ({ onClose }) => { | |
| try { | ||
| // Sending a POST request to create a new room. | ||
| // You might also send additional parameters (e.g., room type, settings). | ||
| const response = await fetch('http://localhost:1313/rooms', { | ||
| const response = await fetch(`${baseURL}/rooms`, { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
|
|
||
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.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: AOSSIE-Org/DebateAI
Length of output: 14760
🏁 Script executed:
Repository: AOSSIE-Org/DebateAI
Length of output: 21304
🏁 Script executed:
Repository: AOSSIE-Org/DebateAI
Length of output: 276
Reset the peer connection after an unanswered offer.
If the WebSocket disconnects before the answer arrives,
pc.signalingStateremainshave-local-offer. Reconnection clears onlypeerOfferStartedRef.current, so the stable-state guard blocks every retry. Opponent video can remain unavailable until reload.Rollback or recreate the
RTCPeerConnection, re-add local tracks, and retry negotiation. Fix this before release, mate.🤖 Prompt for AI Agents