Testing real SDK failures (dropped WebSocket, failed reconnects, bad location fetch) previously required network proxies, or manual throwing of exceptions or returning failures — all slow, inconsistent
A in-app way to force any SDK failure path at runtime, instantly, without touching source code or external tooling. Each failure key can be toggled independently. It defaults to a no-op in production so there is zero risk in release builds.
Three pieces:
FailureKey — enum of every injectable failure point.-FailureInjector — interface: enable, disable, setEnabled, isEnabled, clear, throwDebugFault, sendFailResult.NoOpFailureInjector — default implementation; isEnabled always returns false, all other methods do nothing.At each guarded site in the SDK the pattern is the same:
if (failureInjector.isEnabled(FailureKey.FAIL_X)) {
return failureInjector.sendFailResult(FailureKey.FAIL_X) // or throwDebugFault
}
// normal path continues
| Key | File | Mechanism |
|---|---|---|
FAIL_JOIN_CALL |
Call.kt |
sendFailResult |
FAIL_LOCATION |
StreamVideoClient.kt |
sendFailResult |
FAIL_WS_CONNECT |
SfuSocket.kt |
throwDebugFault |
FAIL_FAST_RECONNECT |
SfuSocket.kt |
throwDebugFault |
FAIL_FULL_REJOIN |
SfuSocket.kt |
throwDebugFault |
FAIL_MIGRATE |
SfuSocket.kt |
throwDebugFault |
There are others. You can find it on the PR [add link here]

