From 390e637d4e9090e6258ccc3d3a0a3f877d81b25c Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:14:26 +0800 Subject: [PATCH] fix(app): clarify site entry and update guidance (#458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem and outcome / 问题与结果 The App's update notice lacked a separate release-note link and any distinction for a new major release. Site entry also required users to supply the URL scheme. This maintenance phase keeps direct manual downloads, adds concise major-upgrade guidance in the App and Server log, and accepts bare Site domains through the existing App normalizer. Explicit HTTP/HTTPS origins retain their meaning. The shared launcher preview and accessibility copy follow the same behavior. Website brand baselines are aligned; source-map-js is updated to 1.2.2 in both build lockfiles. Windows capture self-tests now retain the first worker exception and report the failing phase and output progress without changing deadlines or production capture behavior. The Magicsock assessment remains documentation only. ## Release notes ### 中文 这是一次维护更新,重点改善 Piik App 的站点连接和版本更新体验。现有设置和连接协议保持兼容。 - **站点地址填写更省事:** 可以直接输入域名,App 自动补全 HTTPS;粘贴完整 HTTP/HTTPS 网址也可直接使用。 - **更新入口更清晰:** 更新按钮继续下载对应平台的程序包,“版本说明”可单独打开查看;两项操作分排居中。 - **大版本升级有提示:** 今后检测到新的大版本时,App 会显示简短升级提醒,Server 也会在日志中提示查看不兼容改动。 - 修正启动页的读屏提示,并对齐官网标志中的小电视与 Piik 字样。 ### English This maintenance update makes Piik App's Site entry and update notices easier to use. Existing settings and connection protocols remain compatible. - **Easier Site entry:** Enter a domain and the App adds HTTPS, or paste a complete HTTP/HTTPS address. - **Clearer update actions:** The update button still downloads the matching platform package. Release notes open separately, with both actions centered on their own rows. - **Major-upgrade guidance:** When a newer major release becomes available, the App shows a short upgrade notice and the Server log directs operators to its breaking changes. - Corrected launcher screen-reader text and aligned the website's television mark with the Piik wordmark. ## Verification / 验证 - `npm run check`: 81 test files / 1,378 tests passed; type checking and production Web build passed. - `npm run build:website`: homepage, film and bilingual documentation build passed. - Launcher browser checks: ordinary/major updates, GitHub/Gitee metadata fallback, exact package/release links, no download during detection, missing-package page fallback, Chinese/English/visual modes, light/dark themes, 320–1440px layouts and scoped accessibility checks passed. Network metadata is simulated in these checks. - Bare domain, complete HTTPS and explicit HTTP inputs reached the launch request; App configuration and launcher tests passed, including normalization and invalid origins. Go vet passed for the affected packages. - Repository hygiene and documentation checks passed; existing documentation-length and Web bundle-size warnings remain. - `npm run check:go`: Go tests, formatting, vet, registered non-Darwin target builds, Windows native build, deterministic capture regressions, probe and source enumeration passed. Darwin cgo builds were skipped on this Windows runner as designed. ## Impact / 影响 Maintenance release: v1.9.2. No public wire or storage change: Browser/server v23, Native control v9, capture v7 and SQLite schema 2 are unchanged. No media, route, room-authority or automatic-installation behavior changes. Site origin validation remains strict; a missing scheme defaults to HTTPS without network probing or silent HTTP fallback. Configs written by this version still contain complete origins. Historical installed Apps retain their released update behavior. Future major upgrades still need release-specific compatibility instructions. Physical macOS/Linux capture and reporter-dependent issues remain outside this maintenance change. --- cmd/piik-app/README.md | 6 ++- cmd/piik-app/README.zh-CN.md | 3 +- cmd/piik-server/release.go | 8 +++- cmd/piik-server/release_test.go | 22 ++++++++++ docs/guide/getting-started.md | 10 +++-- docs/guide/getting-started.zh-CN.md | 6 ++- .../research/cross-platform-client-runtime.md | 36 +++++++++++++++ docs/research/nat-traversal.md | 44 +++++++++++++++++++ docs/standards/configuration.md | 5 +++ docs/standards/versioning.md | 23 ++++++++++ docs/todo.md | 16 ++++--- internal/app/config/config.go | 3 ++ internal/app/config/config_test.go | 16 +++++++ internal/app/launcher/server_test.go | 21 +++++++++ .../capture/windows/capture_control.test.cpp | 35 ++++++++++++--- package-lock.json | 6 +-- site/assets/brand.css | 3 ++ site/docs/package-lock.json | 6 +-- site/styles.css | 2 +- .../components/living/AppReleaseNotice.tsx | 37 ++++++++++++++++ src/client/components/living/LauncherForm.tsx | 17 ++++--- src/client/lib/release-update.ts | 12 +++-- src/client/locales/en.ts | 3 ++ src/client/locales/zh.ts | 3 ++ src/client/pages/AppLauncherPage.tsx | 28 ++---------- src/client/pages/ControlsPreview.tsx | 18 +++++++- src/client/styles.css | 3 ++ tests/release-update.test.ts | 22 ++++++++-- 28 files changed, 348 insertions(+), 66 deletions(-) create mode 100644 src/client/components/living/AppReleaseNotice.tsx diff --git a/cmd/piik-app/README.md b/cmd/piik-app/README.md index bdf547d21..7e487a5a2 100644 --- a/cmd/piik-app/README.md +++ b/cmd/piik-app/README.md @@ -35,8 +35,10 @@ publication are separate steps in [deployment](../../docs/deployment.md). covers saved preferences and custom paths. - The `--site`, `--local`, and `--link` flags select a mode for CI and development. - The default launcher checks official releases after it opens, using GitHub - first and Gitee if GitHub is unavailable. It opens the matching platform ZIP - when available, falling back to the release page. It does not install or replace the App. + first and Gitee if GitHub is unavailable. Click the update button to download + the matching platform ZIP, or open the release page when no package matches. + **Release notes** opens separately; a new major version includes an upgrade + warning. The App does not install or replace itself. Local rooms last for this App run and work on a reachable LAN. **Public invite** uses the packaged Cloudflare Tunnel helper to expose that same room service at a diff --git a/cmd/piik-app/README.zh-CN.md b/cmd/piik-app/README.zh-CN.md index f1cda2092..8555b0fa5 100644 --- a/cmd/piik-app/README.zh-CN.md +++ b/cmd/piik-app/README.zh-CN.md @@ -29,7 +29,8 @@ Apple 芯片或 Intel Mac,以及 macOS 13 或更新版本。构建程序包与 [App 配置](../../docs/standards/configuration.md#piik-app-configuration)。 - `--site`、`--local` 和 `--link` 用于在 CI 或开发时直接选择模式。 - 默认启动页打开后会检查官方发布,优先使用 GitHub,GitHub 不可用时使用 Gitee。 - 有对应平台的 ZIP 时直接打开下载地址,否则打开发布页。App 不会自行安装或替换程序。 + 点击更新按钮下载对应平台的 ZIP,没有匹配包时打开发布页。 + **版本说明** 可单独查看;发现新的大版本时会显示升级提示。App 不会自行安装或替换程序。 本地房间仅在本次 App 运行期间有效,适用于设备间可互相访问的局域网。 **公网邀请** 通过程序包中的 Cloudflare Tunnel 辅助程序,为同一个房间服务提供临时 HTTPS 地址。 diff --git a/cmd/piik-server/release.go b/cmd/piik-server/release.go index e9c818edf..79e03972c 100644 --- a/cmd/piik-server/release.go +++ b/cmd/piik-server/release.go @@ -126,7 +126,13 @@ func logReleaseNotice(logger *slog.Logger, result releaseResult) { if result.CurrentVersion != nil { current = *result.CurrentVersion } - logger.Info(message, "event", "release-check", "status", result.Status, + level := slog.LevelInfo + if result.Status == statusUpdateAvailable && semver.IsValid(current) && + semver.Major(*result.LatestVersion) != semver.Major(current) { + level = slog.LevelWarn + message = "A new major Piik release is available; review breaking changes in the release notes before upgrading" + } + logger.Log(context.Background(), level, message, "event", "release-check", "status", result.Status, "currentVersion", current, "latestVersion", *result.LatestVersion, "releaseUrl", *result.ReleaseURL) } diff --git a/cmd/piik-server/release_test.go b/cmd/piik-server/release_test.go index 0a0feb997..fb5e03920 100644 --- a/cmd/piik-server/release_test.go +++ b/cmd/piik-server/release_test.go @@ -51,6 +51,28 @@ func TestReleaseNoticeUsesOperatorLogsOnlyForAvailableChoices(t *testing.T) { } } +func TestReleaseNoticeWarnsAboutANewerMajorWithoutChangingCheckerStatus(t *testing.T) { + for _, current := range []string{"v1.9.1", "v2.0.0-rc.1", "development"} { + t.Run(current, func(t *testing.T) { + var output bytes.Buffer + version, page := "v2.0.0", releaseURLPrefix+"v2.0.0" + logReleaseNotice(slog.New(slog.NewJSONHandler(&output, nil)), releaseResult{ + Status: statusUpdateAvailable, CurrentVersion: ¤t, LatestVersion: &version, ReleaseURL: &page, + }) + var entry map[string]any + if err := json.Unmarshal(output.Bytes(), &entry); err != nil { + t.Fatal(err) + } + warning := current == "v1.9.1" + if (entry["level"] == "WARN") != warning || + strings.Contains(entry["msg"].(string), "breaking changes") != warning || + entry["status"] != statusUpdateAvailable || entry["releaseUrl"] != page { + t.Fatalf("incorrect major release notice: %v", entry) + } + }) + } +} + func TestParseReleaseMetadataAcceptsOnlyTheStrictReleaseIdentity(t *testing.T) { tagged := func(version, page string) string { return `{"tag_name":"` + version + `","html_url":"` + page + `"}` diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 889c079f8..7b03b958b 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -76,6 +76,10 @@ restrictive networks may load the page but block video. **Screens** as available. Pick the actual source and sound option. 5. Copy and send the room invitation. Keep both the App and sharing tab open. +When the launcher offers an update, **Release notes** opens its details on GitHub +or Gitee. A new major version includes a compatibility warning; read the upgrade +instructions before replacing your App. + | Filename contains | Platform | | --- | --- | | `windows-amd64` | Windows x64 | @@ -101,9 +105,9 @@ See the [App guide](../../cmd/piik-app/README.md) for package and runtime detail For Local room and Public invite, expand **Site passphrase** to set an optional access passphrase. -For **Connect to Site**, enter the full site address, such as -`https://demo.piik.tv`, then choose **Open Piik**. Enter the site's passphrase -on the page that opens if asked. +For **Connect to Site**, enter a domain such as `demo.piik.tv` or paste the full +site address, then choose **Open Piik**. HTTPS is added when omitted; for an HTTP +site, include `http://`. Enter the site's passphrase on the page that opens if asked. After opening the site through the App once, the same browser remembers that entry. Keep the App running with that site configured and you can visit the address directly. **Start sharing** opens the selector; choose **Apps / Windows** diff --git a/docs/guide/getting-started.zh-CN.md b/docs/guide/getting-started.zh-CN.md index 07b8d0b18..04d6bc1a9 100644 --- a/docs/guide/getting-started.zh-CN.md +++ b/docs/guide/getting-started.zh-CN.md @@ -69,6 +69,9 @@ App 的本地房间和临时公网邀请会随本次 App 退出而结束。 然后选定要分享的画面与声音。 5. 复制房间邀请发给朋友。分享期间保持 App 和分享标签页打开。 +启动页提示更新时,可点击 **版本说明** 查看 GitHub 或 Gitee 上的详情。 +跨大版本更新会显示兼容性提醒;替换 App 前,请先阅读升级说明。 + | 文件名包含 | 适用平台 | | --- | --- | | `windows-amd64` | Windows x64 | @@ -92,7 +95,8 @@ Linux 原生采集还需要[系统组件](../../native/capture/linux/README.md) 本地房间和公网邀请可展开 **站点口令** 设置可选的访问口令。 -使用 **连接站点** 时,填写完整地址,例如 `https://demo.piik.tv`,然后点击 **进入 Piik**。 +使用 **连接站点** 时,输入域名(例如 `demo.piik.tv`)或粘贴完整网址,然后点击 **进入 Piik**。 +省略前缀时自动使用 HTTPS;HTTP 站点请填写 `http://`。 如果站点要求访问口令,在打开的站点页面输入。通过 App 打开过一次后,同一浏览器会记住这个入口。 保持 App 运行并使用该站点配置,之后就能直接访问网址。点击 **开始分享**, 在选择器里选 **程序 / 窗口** 或 **屏幕**,即可使用 App 采集。 diff --git a/docs/research/cross-platform-client-runtime.md b/docs/research/cross-platform-client-runtime.md index 7902cc757..aee09a9f6 100644 --- a/docs/research/cross-platform-client-runtime.md +++ b/docs/research/cross-platform-client-runtime.md @@ -202,6 +202,42 @@ for recoverable edge disconnects. Piik's four-start acquisition limit is not a four-reconnect limit after readiness. Restarting the Quick Tunnel process would allocate a new public address rather than repair the old invitation. +## Major-Upgrade Delivery Assessment + +Reviewed 2026-10-06 against released update checkers and simulated v2.0.0 +metadata. The v1.0.0 checker opens a provider's release page; v1.1.0 and v1.9.1 +choose a matching ZIP on both GitHub and the Gitee fallback. Detection does not +download or install anything: the user must click. These clients have no +major-upgrade warning. The bounded replay used the released source, not the +current candidate's checker. + +The legacy checkers accept exact provider release/asset URLs; release metadata +cannot redirect them to `piik.tv`. A valid GitHub API response wins without +checking whether its page or attachment is reachable. Gitee fallback selects +the highest stable version itself, so keeping GitHub's Latest on a transition +release does not constrain both discovery paths. Publishing a transition +release first cannot guarantee that every installed client receives it. + +[Sparkle](https://sparkle-project.org/documentation/publishing/#major-upgrades) +separates major-upgrade presentation from installation and supports +[website downloads](https://sparkle-project.org/documentation/publishing/#downloading-from-a-web-site). +Its [feature-upgrade guidance](https://sparkle-project.org/documentation/publishing/#upgrading-to-newer-features) +also requires capable readers or a separate feed; metadata alone cannot teach +older readers a new rule. + +[CC Switch's About panel](https://github.com/farion1231/cc-switch/blob/243cd9a93b67f56efac173f32505b4085fb40cae/src/components/settings/AboutSection.tsx) +separates its update action from opening the target version's release notes. +The installed edition downloads, installs and restarts. Reading release notes +is optional. This supports Piik's action hierarchy, not adoption of CC Switch's +installer or update infrastructure; no implementation code was copied. + +The evidence supports direct manual downloads with an optional release-note +link and inline major-upgrade guidance. The accepted behavior belongs to +[versioning](../standards/versioning.md#major-upgrade-guidance). Historical +clients still follow their released behavior; a notice cannot substitute for +actual App/Site compatibility checks. The scope of a future 2.0 break remains +undecided. + ## Remaining Gates - Run the exact clean-revision package on macOS; Linux amd64 is proved. diff --git a/docs/research/nat-traversal.md b/docs/research/nat-traversal.md index f629b0a99..cee29a1ae 100644 --- a/docs/research/nat-traversal.md +++ b/docs/research/nat-traversal.md @@ -317,6 +317,50 @@ still needs room-authorized key/endpoint exchange, MTU/resource limits and mixed Browser/Native behavior. The nested probe module and full evidence stay on that isolated branch; production dependencies and routing remain unchanged. +### Integration Cost And Recovery Controls + +The 2026-10-06 assessment retains the probes on `spike/magicsock-assessment` +at `fea0587f`, based on current main. These nested Go modules are outside Piik's +build and dependency graph. Repeated local Tailcat bootstrap, peer denial, +revocation and synthetic SRTP media checks passed; the raw magicsock direct-path +matrix again found the same reachable classes as fresh Pion ICE. Retired shared +mapping-cache reproductions remain causal controls, not the current baseline. + +[Tailcat](https://github.com/tailscale/tailcat/blob/b4dc28e8aa8936f0a90a41ad8293a64e3d6b645f/README.md) +provides a supported Go reuse lead: magicsock plus WireGuard, with DERP bootstrap +and relay fallback. Its Browser path at that pin is relay-only. In the isolated +Linux kernel NAT comparison on 2026-10-05, both stacks connected directly through +ordinary/ordinary and open/hard gateways in either direction. Neither delivered +fresh direct payloads through ordinary/hard, hard/ordinary, hard/hard or blocked +UDP pairs within the observation window. Tailcat delivered those cases while +the fixture relay remained available. This demonstrates relay coverage, not +an additional P2P reachability class or a field success rate. + +Replacing one gateway mapping without notifying endpoints separated recovery +from initial reachability. Neither established direct path delivered within +20 seconds with the relay closed. Fresh Pion discovery/exchange recovered in +about 0.6 seconds after it was started. Tailcat recovered delivery in about +6.5 seconds through its retained relay; closing it immediately lost delivery +again. Keeping traffic and discovery alive for 45 seconds allowed subsequent +direct delivery after relay closure. Both gateway directions were checked. +These timings have different detection/setup boundaries and are not a Piik +startup or playback benchmark. + +The raw Bind adapter also has a composition cost: it consumes unwrapped STUN +payloads, and its discovery retry can outlive Pion's initial check budget. +Dropping the first discovery packet in each direction reproduced that failure; +increasing only the fixture's ICE budget recovered media. The ordinary Pion +loss control recovered without that override. Do not adopt packet prefixes, +diagnostic Ping polling or wider product deadlines as integration shortcuts. + +Current recommendation: keep the transport isolated. Go reuse is feasible, but +new key authorization/revocation, underlay readiness, packet-size limits and +relay operation have no demonstrated direct-coverage benefit sufficient for +product integration. A future trial needs matched networks with a repeatable +benefit, separate direct/relayed/first-media results, and current room/route +ownership. IPv6, gateway mapping, Piik prediction, physical routers, decoded +playback and mixed Browser/Native fanout remain outside this comparison. + ## Native Mapping Cache And Retry Lifetimes Pion ICE `v4.4.0` caches a shared socket's STUN mapping by destination for 25 diff --git a/docs/standards/configuration.md b/docs/standards/configuration.md index 12f9529be..040ea29b6 100644 --- a/docs/standards/configuration.md +++ b/docs/standards/configuration.md @@ -111,6 +111,11 @@ schema field. The user settings are: | `site` | Saved Piik Site origin. The launcher or `--site` updates it. | | `localAccessPassword` | Empty by default. Optional password for the App's Local room authority, with the same exact-match behavior as `SITE_ACCESS_PASSWORD`. It is separate from a hosted site's password. | +Site input in the launcher and `--site` defaults to HTTPS when the scheme is +omitted; explicit HTTP or HTTPS is preserved. The App saves the normalized origin +and still rejects credentials, room paths, queries and fragments. It does not +probe protocols or downgrade a failed HTTPS connection to HTTP. + The launcher remembers the last mode confirmed with the launch button. This optional preference lives beside the configuration as `client.json.mode` (or `.mode`); removing it restores the initial selection without diff --git a/docs/standards/versioning.md b/docs/standards/versioning.md index 2d0a747f0..d218dd5cc 100644 --- a/docs/standards/versioning.md +++ b/docs/standards/versioning.md @@ -122,6 +122,29 @@ notice. Unknown SHA is not inferred from a branch name in GitHub metadata. The publisher records a full SHA in `target_commitish` and verifies actual tag identity separately. Stable update notices ignore prereleases. +### Major-Upgrade Guidance + +The App update notice keeps a separate link to the selected provider's exact +release page. A newer major adds a short, visible breaking-change notice; the +Server logs the same distinction while preserving its checker JSON and exit +codes. This is release guidance, not a replacement for actual wire checks. +Updates remain a manual action. Release prose stays on GitHub/Gitee; the App +does not fetch or render remote Markdown or add a second changelog store. +Direct download remains the primary action; reading notes is optional. Keep the +major warning inline, without a confirmation dialog or mandatory website detour. + +Older installed Apps cannot acquire new warning UI from release metadata. +Their historical download behavior is accepted; do not split release feeds or +force a stepping-stone release solely to make advisory presentation identical. +Before a major release, put bilingual upgrade guidance near the top of its +release notes and on the website download entry. Name the actual incompatible +App/Site combinations, required upgrade order, interruptions and any persistent +data implications. Do not assume everyone installed the preceding minor/patch. +Verify the oldest relevant public App/page and the last preceding-major release +against the candidate: actual mismatches must fail clearly at their owning +contract. Keep historical packages available through GitHub releases. A major +preparation change does not itself authorize a wire bump, migration or release. + ## Automatic Publication Before a product-changing merge or manual run that can publish, present the diff --git a/docs/todo.md b/docs/todo.md index 3911685fe..ed06b4afa 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -7,11 +7,8 @@ history. A parked idea is not implementation authority. ## Now -- [ ] **Assess Native Magicsock transport.** Compare the isolated Go transport - with the repaired Pion baseline under the [NAT evidence boundary](#next-p2p-connection-and-feedback-evidence). - Establish a measured benefit, supported paths, resource/authority bounds and - compatibility cost before accepting product integration. Experiments do not - establish a connectivity gain or authorize publication. +No active implementation work. Deferred proposals and evidence-dependent reports +remain below; release delivery is tracked by the pipeline and deployment records. ## Held By Owner @@ -41,6 +38,11 @@ history. A parked idea is not implementation authority. These proposals remain deferred beyond the accepted interaction phase. +- [ ] **Native Magicsock integration.** The [isolated comparison](./research/nat-traversal.md#integration-cost-and-recovery-controls) + establishes Go feasibility and relay-assisted recovery, but no additional + direct-reachability class in its tested matrix. Keep product transport unchanged. + Reopen integration only for a repeatable benefit on matched networks that + justifies the extra identity, readiness, packet-size and relay responsibilities. - [ ] **Managed Demo hosting.** Evaluate cost and public UDP support before any migration. The assessment remains outside the current product release; keep the existing P2P-only Demo deployment until a provider and operating boundary @@ -61,6 +63,10 @@ These proposals remain deferred beyond the accepted interaction phase. These reports remain unmatched. A local repair or successful test is not proof of a reporter's cause; research owns the completed experiments and their limits. +- [ ] **Intermittent native capture self-test failure.** The worker check now + records its phase, original exception and per-output progress. A local pass + does not explain the earlier CI failure; use the next failed run's diagnostics + before changing deadlines or worker behavior. - [ ] **macOS and Linux physical capture.** Complete the remaining capture/audio checks in [verification status](./verification-status.md#device-evidence-boundary), including an Intel Mac with a usable hardware H.264 encoder, an ARM64 Linux diff --git a/internal/app/config/config.go b/internal/app/config/config.go index 48aa18a79..62583a33d 100644 --- a/internal/app/config/config.go +++ b/internal/app/config/config.go @@ -103,6 +103,9 @@ func NormalizeSite(value string) (string, error) { if value == "" { return "", nil } + if !strings.Contains(value, "://") { + value = "https://" + value + } parsed, err := url.Parse(value) if err != nil || (parsed.Scheme != "http" && parsed.Scheme != "https") || parsed.Host == "" || parsed.User != nil || diff --git a/internal/app/config/config_test.go b/internal/app/config/config_test.go index ffa13195b..61190f58f 100644 --- a/internal/app/config/config_test.go +++ b/internal/app/config/config_test.go @@ -143,6 +143,14 @@ func TestSaveDoesNotModifyPreviousFileInPlace(t *testing.T) { func TestNormalizeSiteAcceptsOnlyAPlainWebOrigin(t *testing.T) { for value, want := range map[string]string{ + "": "", + " \t ": "", + "share.example": "https://share.example", + " Share.Example:443/ ": "https://share.example", + "share.example:8443": "https://share.example:8443", + "[::1]:8443": "https://[::1]:8443", + "bücher.example": "https://xn--bcher-kva.example", + " HTTPS://Share.Example/ ": "https://share.example", "https://share.example": "https://share.example", "https://Share.Example:443/": "https://share.example", "http://Share.Example:80": "http://share.example", @@ -158,6 +166,14 @@ func TestNormalizeSiteAcceptsOnlyAPlainWebOrigin(t *testing.T) { } } for _, value := range []string{ + "https://https://share.example", + "share.example/r/9527", + "share.example?mode=host", + "share.example#credential", + "user:pass@share.example", + "share.example:65536", + "ftp://share.example", + "javascript:alert(1)", "file:///tmp/app", "https://user:pass@share.example", "https://share.example/room", diff --git a/internal/app/launcher/server_test.go b/internal/app/launcher/server_test.go index 819c51d63..5ceeb5c75 100644 --- a/internal/app/launcher/server_test.go +++ b/internal/app/launcher/server_test.go @@ -251,12 +251,33 @@ func TestLauncherRequiresTheEmbeddedBrowserBuild(t *testing.T) { } } +func TestLauncherNormalizesSiteSelection(t *testing.T) { + for input, want := range map[string]string{ + " Share.Example:443/ ": "https://share.example", + "https://Share.Example/": "https://share.example", + "http://192.168.1.4:8787/": "http://192.168.1.4:8787", + } { + t.Run(input, func(t *testing.T) { + payload, err := json.Marshal(Selection{Mode: ModeSite, Language: "en", Site: input}) + if err != nil { + t.Fatal(err) + } + selection, err := decodeSelection(bytes.NewReader(payload)) + if err != nil || selection.Site != want { + t.Fatalf("site selection = %+v, %v; want %q", selection, err, want) + } + }) + } +} + func TestLauncherRejectsInvalidSelections(t *testing.T) { for name, payload := range map[string]string{ "unknown": `{"mode":"other","language":"en"}`, "local-site": `{"mode":"local","language":"en","site":"https://share.example"}`, "missing-site": `{"mode":"site","language":"en"}`, "site-path": `{"mode":"site","language":"en","site":"https://share.example/path"}`, + "bare-site-path": `{"mode":"site","language":"en","site":"share.example/path"}`, + "site-credentials": `{"mode":"site","language":"en","site":"user:pass@share.example"}`, "site-password": `{"mode":"site","language":"en","site":"https://share.example","localAccessPassword":"valid-pass"}`, "unknown-field": `{"mode":"local","language":"en","extra":true}`, "password-type": `{"mode":"local","language":"en","localAccessPassword":123}`, diff --git a/native/capture/windows/capture_control.test.cpp b/native/capture/windows/capture_control.test.cpp index 915d3d3b6..b94cb9946 100644 --- a/native/capture/windows/capture_control.test.cpp +++ b/native/capture/windows/capture_control.test.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include @@ -62,6 +64,7 @@ void CheckWorkers() { std::mutex mutex; std::condition_variable changed; std::exception_ptr failure; + size_t failed_layer = 0; std::promise entered, release; auto entered_future = entered.get_future(); auto released = release.get_future().share(); @@ -99,7 +102,10 @@ void CheckWorkers() { } } catch (...) { std::lock_guard lock(mutex); - failure = std::current_exception(); + if (!failure) { + failure = std::current_exception(); + failed_layer = layer; + } changed.notify_one(); } }); @@ -108,28 +114,45 @@ void CheckWorkers() { auto input = std::make_shared(Input{index}); for (auto& mailbox : mailboxes) mailbox.Submit(input); }; - auto wait = [&](auto predicate) { + auto wait = [&](const char* phase, auto predicate) { std::unique_lock lock(mutex); const bool ready = changed.wait_for(lock, std::chrono::seconds(2), [&]() { return failure || predicate(); }); + if (!ready || failure) { + std::fprintf(stderr, "capture_control: phase=%s result=%s\n", phase, + failure ? "worker-exception" : "timeout"); + if (failure) { + try { std::rethrow_exception(failure); } + catch (const std::exception& error) { + std::fprintf(stderr, " layer=%zu error=%s\n", failed_layer, error.what()); + } catch (...) { + std::fprintf(stderr, " layer=%zu error=non-standard-exception\n", failed_layer); + } + } + for (size_t layer = 0; layer < workers.size(); ++layer) { + std::fprintf(stderr, " layer=%zu last=%u count=%u retired=%u\n", + layer, last[layer], count[layer], retired[layer]); + } + std::fflush(stderr); + } assert(ready && !failure); }; submit(1); assert(entered_future.wait_for(std::chrono::seconds(2)) == std::future_status::ready); for (uint32_t index = 2; index <= 4; ++index) submit(index); - wait([&]() { return last[1] == 4 && last[2] == 4; }); + wait("independent-outputs", [&]() { return last[1] == 4 && last[2] == 4; }); mailboxes[0].RequestKeyFrame(); release.set_value(); - wait([&]() { return last[0] == 4; }); + wait("pending-recovery", [&]() { return last[0] == 4; }); assert(count[0] == 2 && recovery[0]); // New request survived the older keyframe; pending 2/3 were replaced. mailboxes[1].SetActive(false); mailboxes[2].SetActive(false); submit(5); - wait([&]() { return last[0] == 5 && retired[1] == 1 && retired[2] == 1; }); + wait("output-retirement", [&]() { return last[0] == 5 && retired[1] == 1 && retired[2] == 1; }); assert(last[1] == 4 && last[2] == 4); mailboxes[0].SetBitrate(30'000); for (auto& mailbox : mailboxes) { mailbox.SetActive(true); mailbox.RequestKeyFrame(); } submit(6); - wait([&]() { return last[0] == 6 && last[1] == 6 && last[2] == 6; }); + wait("output-reactivation", [&]() { return last[0] == 6 && last[1] == 6 && last[2] == 6; }); assert(recovery[0] && recovery[1] && recovery[2]); const auto stopped = std::chrono::steady_clock::now(); for (auto& mailbox : mailboxes) mailbox.Stop(); diff --git a/package-lock.json b/package-lock.json index 702b9d4c3..077150386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1589,9 +1589,9 @@ "license": "ISC" }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "dev": true, "license": "BSD-3-Clause", "engines": { diff --git a/site/assets/brand.css b/site/assets/brand.css index b0f65c8da..15cc66772 100644 --- a/site/assets/brand.css +++ b/site/assets/brand.css @@ -1,5 +1,8 @@ .identity { display:flex; gap:11px; align-items:center; text-decoration:none; font-size:32px; font-weight:800; letter-spacing:-.065em; line-height:1; color:inherit; } .identity .mascot { width:37px; height:37px; overflow:visible; } +/* Align the feet with the wordmark baseline, allowing for the SVG's bottom inset. */ +.identity[data-brand],.footer-identity { align-items:baseline; } +.identity[data-brand] .mascot,.footer-identity > svg { translate:0 .1em; } .identity-dot { color:#e4572e; } .identity .mascot-face,.identity .mascot-eye-open,.identity .mascot-sparkles { transform-box:fill-box; transform-origin:center; } @media (prefers-reduced-motion:no-preference) { diff --git a/site/docs/package-lock.json b/site/docs/package-lock.json index 5387e9c4a..9f507bb09 100644 --- a/site/docs/package-lock.json +++ b/site/docs/package-lock.json @@ -2329,9 +2329,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "dev": true, "license": "BSD-3-Clause", "engines": { diff --git a/site/styles.css b/site/styles.css index 25663a12b..a895abaff 100644 --- a/site/styles.css +++ b/site/styles.css @@ -203,7 +203,7 @@ details p { max-width: 610px; padding: 0 24px 23px 0; color: var(--muted); font- .docs-links p { margin: 0; font-size: 13px; } .project-note .docs-note { margin-bottom: 0; font-size: 12px; } .site-footer { display: flex; align-items: center; flex-wrap: wrap; column-gap: 20px; padding-block: 48px 29px; } -.footer-identity { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 750; letter-spacing: -.035em; } +.footer-identity { display: flex; gap: 8px; font-size: 21px; font-weight: 750; letter-spacing: -.035em; } .footer-identity svg { width: 28px; height: 28px; } .footer-identity p { color: var(--muted); margin-left: 12px; font-size: 11px; font-weight: 400; letter-spacing: 0; } .footer-links { display: flex; flex-wrap: wrap; gap: 24px; margin-left: auto; font-size: 12px; } diff --git a/src/client/components/living/AppReleaseNotice.tsx b/src/client/components/living/AppReleaseNotice.tsx new file mode 100644 index 000000000..5acba430f --- /dev/null +++ b/src/client/components/living/AppReleaseNotice.tsx @@ -0,0 +1,37 @@ +import { useId } from "react"; +import type { ReleaseUpdateNotice } from "../../lib/release-update"; +import { useCopy, type CopyKey } from "../../ui/copy"; +import { Glyph } from "../../ui/icons"; +import { Tooltip } from "./Tooltip"; + +const labels: Record = { + "update-available": "client.update.available", + "major-update": "client.update.major", + "different-build": "client.update.differentBuild", + "official-release": "client.update.official", +}; + +export function AppReleaseNotice({ update }: { update: ReleaseUpdateNotice }) { + const { vis, t } = useCopy(); + const warningId = useId(); + const major = update.kind === "major-update"; + const label = `${t(labels[update.kind])} · ${update.version}`; + return
+ + {major &&

+ {t("client.update.majorHint")} +

} +
; +} diff --git a/src/client/components/living/LauncherForm.tsx b/src/client/components/living/LauncherForm.tsx index 064c20326..3df0388e5 100644 --- a/src/client/components/living/LauncherForm.tsx +++ b/src/client/components/living/LauncherForm.tsx @@ -166,12 +166,15 @@ export function LauncherForm({ {mode === "site" ? (