Spaces:
Running
Running
๐ง v4.3: Web app deep audit โ 12 bugs fixed (4 critical)
#6
by gaurv007 - opened
Deep Audit of web/ โ 12 Bugs Found & Fixed
๐ด Critical Fixes
BUG 1: Gradio API endpoint names wrong (analyze/route.ts)
- Old:
/gradio_api/call/_analysis_and_index(private fn name, not exposed) - Fix: Added
api_name="analyze"toscan_btn.click()inapp.py, use/gradio_api/call/analyze
BUG 2: Compare route corrupts contract text (compare/route.ts)
- Old: HTML-escaped
<โ<BEFORE sending to backend for analysis - Fix: Removed text mutation (same bug that was already fixed in analyze/route.ts v4.1)
BUG 3: Redline route points to non-existent API (redline/route.ts)
- Old: Fallback URL
gaurv007-clauseguard-api.hf.spacedoesn't exist - Fix: Rewrote to use Gradio Space API with FastAPI as optional primary
BUG 4: Chat route uses broken Gradio endpoint (chat/route.ts)
- Old: Called non-existent
/gradio_api/call/chatwhich always fails - Fix: Removed broken Gradio fallback; route now uses FastAPI only with clear error messages
๐ก Medium Fixes
BUG 7+8: .env.example stale/missing URLs (.env.example)
- Removed non-existent
CLAUSEGUARD_API_URLdefault, addedCLAUSEGUARD_GRADIO_URL
BUG 9: Version badge shows v4.0 (nav.tsx) โ Updated to v4.3
BUG 10: PDF upload uses wrong pdf-parse API (parse-upload/route.ts)
- Fixed to use standard pdf-parse v1 API with graceful fallback
BUG 12: Analysis not saved to DB (analyze/route.ts)
- Added
analysestable insert so history works for web app users
Gradio app.py changes
- Added
api_name="analyze"toscan_btn.click() - Added
api_name="compare"tocomp_btn.click()
Files changed
app.pyโ api_name parameters for Gradio endpointsweb/app/api/analyze/route.tsโ endpoint name fix + DB saveweb/app/api/compare/route.tsโ removed text corruption + endpoint fixweb/app/api/redline/route.tsโ complete rewrite for Gradio fallbackweb/app/api/chat/route.tsโ removed broken Gradio fallbackweb/app/api/parse-upload/route.tsโ pdf-parse API fixweb/components/nav.tsxโ version badge v4.3web/.env.exampleโ corrected env vars
gaurv007 changed pull request status to open
gaurv007 changed pull request status to merged