74 Commits

Author SHA1 Message Date
zarazaex69 5dd6822d80 refactor(jitsi): clean up linter suppressions and test helpers 2026-06-01 15:44:59 +03:00
zarazaex69 0684ace550 test(jitsi): update tests for consecutive-failure reconnect model 2026-06-01 15:00:55 +03:00
zarazaex69 649cad5d2d fix(jitsi): reset reconnect count after success 2026-06-01 14:58:32 +03:00
zarazaex69 90e2ed9c33 fix(jitsi): re-latch peer after reconnect 2026-06-01 13:35:36 +03:00
zarazaex69 ac930021b1 fix(jitsi): accept peer epoch changes without reconnect 2026-06-01 13:21:08 +03:00
zarazaex69 1d0a1467e4 test(jitsi): replace keepalive tests with paired chaos 2026-06-01 13:14:34 +03:00
zarazaex69 cc65c033e2 fix(jitsi): prevent reconnect loops and idle 2026-06-01 12:51:06 +03:00
e.barskov bd1a95cac5 fix(jitsi): re-allocate Jicofo focus on reconnect (non-blocking)
The lightweight soft-rejoin path (jSess.Rejoin) skips Jicofo focus
allocation and joins the MUC with a bare presence. After the client
leaves and Jicofo idle-terminates the now-empty conference
(session-terminate <expired/>), the room/focus is torn down. A bare
rejoin presence is then rejected by Prosody with
<presence type='error'><not-allowed/>, and the library's JoinMUC matches
a stale status-110 left in its stanza buffer and falsely reports success.
The engine then waits forever for a session-initiate that never arrives
while actually being outside the room, so the client can never reconnect.

Re-establish the session from scratch via j.JoinMUC instead, which runs
dial -> focus allocation -> MUC join in the correct order (focus first,
so Jicofo recreates the room), exactly like the initial Connect, but
WITHOUT blocking on session-initiate. The fresh session-initiate is
awaited separately via WaitJingleReinitiate once a peer rejoins, so the
non-blocking reconnect contract is preserved.

Verified on a live deployment: two consecutive reconnect cycles now
complete (bridge open sctp -> reconnected -> session opened) where the
old path hung after "waiting for session-initiate".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 00:36:25 +04:00
zarazaex69 dfce46dd5f fix(jitsi): add bridge keepalive loop 2026-05-31 19:41:09 +03:00
zarazaex69 71b1fbdf27 fix(jitsi): make Connect non-blocking, wait for session-initiate async
j.Join() blocks on WaitJingle until Jicofo sends session-initiate,
which only happens when a second participant joins the room. With the
transport-level connect timeout (30-60s), the server crashes if no one
joins in time.

Switch to j.JoinMUC() which returns immediately after joining the MUC.
A background goroutine (waitForJingle) waits for session-initiate and
then opens the bridge + negotiates the PeerConnection. This way Connect
succeeds as soon as the XMPP connection is established, regardless of
whether another participant is present.
2026-05-31 13:07:22 +03:00
zarazaex ab848b4c48 Merge pull request #84 from grandgaev/fix/rtcp-keepalive-wedge
fix(jitsi): break out of rtcpKeepalive on persistent write errors
2026-05-31 07:55:28 +03:00
Rock Brock ffa5d4ac13 fix(jitsi): break out of rtcpKeepalive loop on persistent write errors
When the JVB bridge disconnects but the session is not yet closed
(e.g. during a pending reconnect), rtcpKeepalive spins indefinitely
logging "rtcp keepalive write: io: read/write on closed pipe" every
5 seconds. The process appears alive but is functionally dead —
systemd Restart=always never triggers and the instance becomes
permanently wedged.

Add an error counter that triggers requestReconnect after 3
consecutive WriteRTCP failures, allowing the supervisor to
tear down and re-establish the bridge connection. Reset the
counter on any successful write.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-31 07:23:23 +05:00
zarazaex69 efadd37df4 fix: golangci 2026-05-30 12:16:20 +03:00
zarazaex69 da3bf43721 style: normalize dash usage in comments and logs 2026-05-29 22:08:36 +03:00
zarazaex69 c4984f65d6 fix(jitsi): reuse xmpp session on reconnect. fix #82 2026-05-29 22:07:15 +03:00
zarazaex69 33f46460dc test(e2e): tune videochannel params and reduce chunk timeout 2026-05-28 13:19:14 +03:00
zarazaex69 4fce5773f8 fix(goolom): remove premature onReconnect callback invocation 2026-05-26 01:05:31 +03:00
zarazaex69 fe85457754 fix(jitsi): add RTCP keepalive to prevent JVB session expiry 2026-05-25 12:57:18 +03:00
zarazaex69 e64ed167cc refactor(jitsi): extract openBridgeWS and openBridgeSCTP helpers 2026-05-25 11:39:22 +03:00
zarazaex69 c2170c058b feat(jitsi): add SCTP fallback when colibri-ws is unavailable
- Fixed instances that were not working x3
2026-05-25 10:41:23 +03:00
zarazaex69 12a28e6cbf chore: replace default jitsi URL with meet1.arbitr.ru 2026-05-25 10:08:26 +03:00
zarazaex69 98c6dec4a0 docs: normalize em dash to hyphen in Russian documentation and code comments 2026-05-24 05:31:55 +03:00
zarazaex69 c45e12d5c6 chore: replace default Jitsi URL with meet.cryptopro.ru 2026-05-21 19:07:31 +03:00
zarazaex69 4b7185f411 fix(client): survive liveness loss without killing SOCKS listener 2026-05-21 13:42:22 +03:00
zarazaex69 085aadcad7 refactor: remove SaluteJazz carrier support 2026-05-19 21:39:07 +03:00
zarazaex69 31796efe15 docs: replace meet.cryptopro.ru with meet.small-dm.ru as default 2026-05-18 23:37:10 +03:00
zarazaex69 d872f3c900 docs: replace jitsi.etudevs.ru with meet.cryptopro.ru 2026-05-18 22:30:51 +03:00
zarazaex69 65611d903e docs: replace meet.cryptopro.ru with jitsi.etudevs.ru as default 2026-05-18 22:20:02 +03:00
zarazaex69 143f6dd8a6 feat: add peer-addressed routing across transport and engine layers 2026-05-18 02:38:45 +03:00
zarazaex69 b4dc6d2531 test: add nightly stress and churn coverage 2026-05-16 23:49:22 +03:00
zarazaex69 5347c80db5 fix(jitsi): guard reconnect counter with mutex 2026-05-16 22:24:03 +03:00
zarazaex69 f51889ac52 fix(jitsi): keep bytestream endpoints alive 2026-05-16 20:25:54 +03:00
zarazaex69 5d4592f055 fix(jitsi): reset reconnect limit by window start 2026-05-16 19:28:28 +03:00
zarazaex69 cae76a6c34 fix(jitsi): reset peer epoch before reconnect announce 2026-05-16 19:09:29 +03:00
zarazaex69 032151be98 fix(server): reset peer binding on handshake failure 2026-05-16 18:57:04 +03:00
zarazaex69 acac1121a7 fix(jitsi): add epoch-based bridge frame filtering 2026-05-16 18:46:58 +03:00
zarazaex69 07b86a7559 test(jitsi): guard session type assertions in tests 2026-05-16 18:38:14 +03:00
zarazaex69 a329b1fd56 feat(jitsi): add automatic bridge reconnection 2026-05-16 18:33:24 +03:00
zarazaex69 a321413f83 fix: golangci 2026-05-16 16:44:36 +03:00
zarazaex69 60e731c4bb fix(salutejazz): bound session close on wedged pc shutdown 2026-05-16 16:39:07 +03:00
zarazaex69 a083dfc5f3 refactor: collapse carrier layer into engine
internal/carrier and internal/carrier/builtin sat between transports and
engines, wrapping every engine.Session in carrier.Session +
engineByteStream/engineVideoTrack adapters that mechanically proxied every
method. That layer existed solely to translate Capabilities/AddTrack names;
no behaviour lived above engine.

Replace with internal/engine/builtin: a name-keyed registry that calls
auth.Issue and engine.New directly. Transports look up engine.Session via
enginebuiltin.Open, then type-assert engine.VideoTrackCapable for video
transports. A small per-transport engineVideoSession adapter unifies the
reconnect callback signature (engine uses func(*webrtc.DataChannel); the
transports want func()).

Updates:
- internal/engine/builtin/builtin.go: new Register/Open registry + auth
  pass-through ("none") + auth-driven factories for jazz/telemost/wbstream/jitsi.
- internal/transport/datachannel/transport.go: uses engine.Session directly
  via Capabilities().ByteStream check.
- internal/transport/{seichannel,videochannel,vp8channel}: each gains an
  engineVideoSession adapter and routes Connect/Send/Close/AddTrack through
  the engine session.
- internal/app/session: imports enginebuiltin; carrier.Available() →
  enginebuiltin.Available().
- pkg/olcrtc/olcrtc.go: switches to enginebuiltin.RegisterDefaults.
- internal/carrier and internal/carrier/builtin: deleted.
- Tests rewritten to register a fakeEngineSession (implements engine.Session
  + engine.VideoTrackCapable) through enginebuiltin.Register. The e2e
  memoryStream gains the same dual interface so memorySession is gone.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 14:07:44 +03:00
zarazaex69 a48db522b1 refactor(jitsi): extract peer latch helper logic 2026-05-16 05:43:36 +03:00
zarazaex69 d80d725d5e fix(jitsi): isolate bridge and video to one peer 2026-05-16 05:29:51 +03:00
zarazaex69 6222896921 refactor: improve error context and test clarity 2026-05-16 04:06:55 +03:00
zarazaex 6116130e3b Merge pull request #58 from cyber-debug/refine/livekit-reconnect
refine livekit reconnect and liveness
2026-05-16 03:47:47 +03:00
zarazaex69 4bf72e5b87 fix(salutejazz): close websocket before waiting on shutdown 2026-05-16 02:24:21 +03:00
cyber-debug b7a7e40899 feat: add safe traffic shaping and TLS hardening 2026-05-16 02:10:34 +03:00
cyber-debug a86f5c6948 feat: add reconnect hardening and failover profiles 2026-05-16 02:10:33 +03:00
zarazaex69 5ec58bee98 refactor: extract unstable test logging helper 2026-05-16 01:53:55 +03:00
zarazaex69 f7c157dfe3 fix(jitsi): align session close with leave flow 2026-05-16 01:09:01 +03:00