Files
Piik/docs
AAA 78e0d4194a fix(routing): recover failed connections across route transitions
## Problem and outcome / 问题与结果

An active media connection could fail while a replacement was being prepared, but its failure report was suppressed or attributed to the pending route. Separately, a room revision advanced by another Viewer could invalidate a delayed failure report for a connection that was still current, leaving playback stalled after the browser had already reported the failure.

Failure reporting now follows committed connection ownership. P2P and SFU reports carry the existing physical connection identity; the server accepts a delayed active failure only while that connection and its endpoint session still match. Preparation reports retain their exact operation checks, and stale connections, stale sessions and future revisions remain rejected. This adds no wire fields, recovery timers, dependencies or routing policy.

## Release notes

### 中文

这是一次连接恢复修复,改善分享过程中断线或画面停滞后的自动恢复。

- 修复自动切换线路期间,当前连接失效后可能未触发正确恢复的问题,覆盖 P2P 和服务器兜底线路。
- 修复其他观众加入等房间变化恰好发生时,延迟到达的故障反馈可能被忽略,导致画面停滞后无法自动恢复的问题。
- App 公网邀请或本地模式请房主更新 App 后重新分享,观众刷新页面。使用已部署站点时,请管理员更新 Server,房主和观众刷新页面。

### English

This patch improves automatic recovery when a connection fails or playback stalls during sharing.

- Fixed failures on the current connection being missed or attributed to the wrong route while Piik prepares a replacement. This covers P2P and server fallback connections.
- Fixed delayed failure reports being ignored after another Viewer joins or the room changes, which could leave playback stalled without automatic recovery.
- For App public invitations or Local mode, the Host should update the App and start sharing again; Viewers should reload the page. For a deployed site, update the Server, then refresh the page for the Host and all Viewers.

## Verification / 验证

- `npm run check`: typecheck, 71 test files / 1,003 tests, and the Web production build passed.
- `npm run check:go-core`: Go tests, formatting, vet and supported core target builds passed.
- Browser fault injection passed for delayed reports across room changes, Host and Viewer signaling reconnects, pending-candidate reauthentication, and source replacement during preparation. The previously reproduced stall recovered automatically with one failure report; process, profile and port cleanup passed.
- The embedded SFU H.264 simulcast gate passed with decoded video and audio, a live 720p to 480p profile change, and publication retirement.
- Focused regressions cover Host/Viewer and P2P/SFU report ownership, retired connections, wrong identities, stale sessions and future revisions. Documentation and repository hygiene checks passed.

These results do not establish the original reporter's specific cause. Physical Native capture, representative public networks and long-duration recovery remain outside this local acceptance.

## Impact / 影响

Patch release: **v1.5.3**. No wire, configuration or storage format changes; existing published message handlers remain compatible. The routing contract owns the updated failure-report rule, and TODO retains the outstanding reporter/device evidence boundaries.
2026-09-17 22:56:06 +08:00
..

Piik Documentation

About Piik · 中文介绍 · 中文上手指南

For using Piik, troubleshooting or self-hosting, start with the reader documentation · 中文文档中心. This page also indexes developer and maintainer references.

Guides And References

Task Guide
Use Piik online Open the online site · Online sharing guide
Watch a friend or share my first screen Getting started
Choose an App mode or fix sound and connection trouble First-use help
Page opens but video will not connect / 网页能打开,画面连不上 Connection troubleshooting · 中文排查
Run Piik App, check platform requirements, or build a package App guide · 中文 App 指南
Try or change the source code Run from source
Find a directory or the module responsible for a behavior Repository layout and module map
Find the shared product, design and lifecycle rules Standards index
Host a site for my group Self-hosting · 中文部署
Keep a server running with systemd or Docker Service management · 中文服务管理
Set passwords, ports, or room storage Configuration
Update my server Server updates
Build, publish or recover a maintained release Maintainer release tooling
Send a useful bug report Diagnostics and export
Translate Piik or improve wording Translation guide · 中文翻译教程
Check release and platform readiness Current status

The introduction, getting-started, App, self-hosting, service-management and translation guides are available in English and Chinese. Technical references keep one shared version.

Run from source

You can try the Browser application locally with Node from .node-version, npm from package.json, and Go 1.26 from go.mod. Run these commands from the repository root.

Start the web UI:

npm ci
npm run dev

In a second terminal, start the server. For a POSIX shell:

PORT=8788 PUBLIC_BASE_URL=http://localhost:8787 go run ./cmd/piik-server

Or in PowerShell:

$env:PORT = '8788'
$env:PUBLIC_BASE_URL = 'http://localhost:8787'
go build -o build/dev/piik-server.exe ./cmd/piik-server
./build/dev/piik-server.exe

The fixed Windows executable path avoids repeated firewall prompts from go run. Open localhost:8787, start sharing, and open the invitation in another browser tab to try watching. This localhost invitation stays on your computer; remote invitations need a reachable origin as described in configuration. Browser capture requires localhost or HTTPS.

For the self-contained App, follow App development and packaging, including the platform's native capture requirements.

Work on Piik

Contributing covers the workflow and choosing focused checks. The main verification commands are:

npm run check
npm run check:go

Use the naming and copy guide for product names, commands, role labels and Chinese/English voice. Piik-owned code uses MIT; see the licensing guide for third-party components.

For the public website, see the introduction design and website preview and publishing.

Understand the product

Topic Its reference
Invitations, room codes and passwords Rooms and access
How viewers connect Routing and transport
Screen capture, quality controls and sound Media quality
Host and viewer behavior Presentation and lifecycle
Why a design was chosen Architecture decisions
Measurements and platform limits Research and verification status

Shared conventions

When changing… Follow this owner
Module responsibilities or interfaces Engineering and contract map
Product/tool names, role labels or copy Naming and copy
UI colour, illustration, motion or layout Visual language
Overlays, titles or state indicators Media status
Releases, protocols or stored formats Versions and compatibility
Main protection or automatic publishing GitHub operations
Documentation or a duplicated rule Documentation ownership
Checks, PRs, integration or cleanup Contributing

For ongoing work, use TODO. Project memory provides the compact product map; status indexes current source and deployment boundaries. Completed work lives in Git history and pull requests.