Merge pull request #1892 from PR0M3TH3AN/ai/debug-frontend-20260128-16915912596521663527

fix(ai): frontend console error — ignore .torrent urls in probeUrl (agent)
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-28 13:51:43 -05:00
commit e24207c12d
2 files changed
+16 -14

No files matched your search

+4
View File
@@ -323,6 +323,10 @@ export default class UrlHealthController {
return { outcome: "invalid" };
}
if (trimmed.toLowerCase().endsWith(".torrent")) {
return { outcome: "invalid" };
}
const confirmPlayable = options?.confirmPlayable === true;
const defaultTimeout = this.constants.URL_PROBE_TIMEOUT_MS || 5000;
const urlHealthConstants = this.constants.urlHealthConstants || {};
+12 -14
View File
@@ -1,33 +1,31 @@
from playwright.sync_api import sync_playwright
import sys
import time
from playwright.sync_api import sync_playwright
def run():
with sync_playwright() as p:
# Launch browser (headless by default)
browser = p.chromium.launch()
page = browser.new_page()
# Capture console messages
print("--- Debugging Frontend ---")
# Listen for console messages
page.on("console", lambda msg: print(f"console:{msg.type}: {msg.text}"))
# Capture uncaught exceptions
# Listen for uncaught exceptions
page.on("pageerror", lambda exc: print(f"pageerror: {exc}"))
# Capture failed requests
page.on("requestfailed", lambda request: print(f"requestfailed: {request.url} {request.failure}"))
# Listen for failed requests
page.on("requestfailed", lambda req: print(f"requestfailed: {req.url} {req.failure}"))
try:
print("Navigating to http://localhost:8000...")
page.goto("http://localhost:8000")
# Wait for some time to catch initialization errors
time.sleep(5)
# Wait for network idle or a specific time to allow scripts to execute
page.wait_for_timeout(5000)
except Exception as e:
print(f"Script error: {e}")
finally:
browser.close()
print(f"Navigation failed: {e}")
browser.close()
if __name__ == "__main__":
run()