feat(inspector,engine): stream live traffic over WebSocket (/admin/traffic/ws) with polling fallback

Aperta
#6 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
fastapi, next.js, python, typescript

Direzione di ricerca

Start with engine/app/inspector.py and trace how middleware captures traffic and how GET /admin/traffic returns it. Then read inspector/src/lib/api.ts, inspector/src/components/Workbench.tsx, and engine/tests/test_inspector.py to understand the client state and existing test patterns. Add the WebSocket stream, prefix filtering, Pause/Resume handling, and polling fallback; done means the WebSocket tests pass and the specified pytest, typecheck, and build commands succeed.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

complexity: high engine inspector

Context

Currently the Next.js Inspector polls GET /admin/traffic every 2.5 seconds. Adding a FastAPI WebSocket stream will give developers instant sub-50ms request telemetry while keeping HTTP polling as an automatic fallback if the socket drops.

Scope & Target Files

  • engine/app/inspector.py (add WebSocket broadcaster + /admin/traffic/ws endpoint)
  • inspector/src/lib/api.ts and inspector/src/components/Workbench.tsx
  • Add WebSocket tests in engine/tests/test_inspector.py

Acceptance Criteria

  • Expose WS /admin/traffic/ws in engine/app/inspector.py pushing new captured request events as JSON frames immediately after middleware completion.
  • Respect optional prefix query filtering and Pause/Resume state on the client.
  • Fall back gracefully to HTTP polling if the WebSocket connection closes or fails.
  • Verify both pytest -v and npm run typecheck && npm run build pass cleanly.
Lingua principale
Python
Stelle
0
Fork
1
Merge medio
19h 43m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sepbox-dev/sepbox

Tutte le issue di sepbox-dev/sepbox

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.