Skip to content

refactor: remove websocket streaming support and clean up associated tests

ashritha kunjeti requested to merge websocket into pre-push

Overview

This Merge Request removes all deprecated WebSocket streaming functionality from the backend and simplifies the ASR pipeline to support only REST-based transcription and diarization workflows.

The cleanup includes removal of streaming services, PCM16-specific methods, unused configuration, and related tests, while ensuring all existing REST APIs continue to work correctly with full test coverage maintained.


Changes Made

WebSocket & Streaming Cleanup

  • Removed /stream WebSocket endpoint from app/main.py

  • Deleted app/services/streaming_service.py

  • Removed streaming session cleanup lifecycle logic

  • Removed PCM16 streaming transcription flow from:

    • app/asr_service.py
    • app/asr/router.py
    • ASR engine implementations

ASR Engine Refactor

  • Removed:

    • transcribe_pcm16
    • detect_language_pcm16
  • Cleaned up unused imports and streaming-only utilities

Configuration Cleanup

Removed obsolete configuration related to:

  • STREAMING_*
  • VAD_*

from app/config.py

Test & Documentation Updates

  • Deleted tests/test_streaming_service.py

  • Updated affected unit tests:

    • test_main.py
    • test_engines.py
    • test_asr_service.py
    • test_model_router.py
    • test_whisper_lid_unit.py
  • Updated README to remove streaming/WebSocket references

Additional Fixes

  • Fixed legacy exception syntax issues:
except ValueError, OSError:

updated to:

except (ValueError, OSError):
  • Applied:

    • ruff format
    • ruff check --fix

Validation

  • All tests passing successfully
  • Maintained required coverage threshold (~95%)
  • REST transcription and diarization flows verified after cleanup

Impact

Benefits

  • Reduced backend complexity
  • Easier maintenance and debugging
  • Cleaner ASR architecture
  • Removed unused/dead code paths
  • Faster and more stable test execution

No Impact On

  • REST transcription APIs
  • Diarization workflows
  • Benchmark jobs
  • Existing ASR model functionality

*Closes #29 (closed)

Merge request reports

Loading