Hyeonsang Cho 2e42242888
fix(frontend): retry a failed same-tab reconnect after refresh (#6400)
* fix(frontend): retry a failed same-tab reconnect after refresh

After a refresh the SDK reconnects once from the tab's lg:stream pointer
and keeps that pointer when the join fails. Active-run recovery defers to
the SDK whenever the pointer matches the active run, and its error handler
only scheduled retries for joins it started itself, so a failed reconnect
(at connect time or mid-stream) left the tab without a live stream until
another refresh.

When an SDK reconnect fails, release the pointer and wake the recovery
effect, which rejoins the run if the runs read still reports it active,
with its existing bounded retries. Runs created by this hook's submit
(onCreated) keep their current error handling.

The new native-reconnect-recovery test drives the real SDK useStream, so
it also pins the SDK behavior this relies on: one reconnect per mount and
a pointer that survives a failed join.

* docs(changelog): reference #6400

* test(frontend): pin that a released reconnect skips finished runs

A run handed to recovery after a failed SDK reconnect was never streamed
by this hook, so completedRunIdsRef cannot guard it; only the
server-reported status in activeRunId does. Resolve the runs read with
each terminal status after the failed reconnect and assert recovery
never joins and the pointer stays cleared.

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-10-07 09:53:22 +08:00
..