From 9a3d2862df8aeb5cf07228abdaa867c755c8c4e0 Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Wed, 11 Nov 2026 07:40:06 -0400 Subject: [PATCH] fix(beta): provide a reversible storage reset helper --- cmd/piik-app/README.md | 6 +++++ docs/guide/getting-started.md | 4 ++- docs/guide/getting-started.zh-CN.md | 2 ++ docs/guide/troubleshooting.md | 9 +++++++ docs/guide/troubleshooting.zh-CN.md | 6 +++++ scripts/reset-beta-app-data.ps1 | 41 +++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 scripts/reset-beta-app-data.ps1 diff --git a/cmd/piik-app/README.md b/cmd/piik-app/README.md index 662de02ce..3c639a601 100644 --- a/cmd/piik-app/README.md +++ b/cmd/piik-app/README.md @@ -146,6 +146,12 @@ incompatible, update the domain's Server and connected Apps together, then refre 3. Start with the same application-data directory. Send the current invitation if its address changed. +If a private beta reports `unsupported_storage_version`, stop App and run the +supplied `reset-beta-app-data.ps1` helper. It renames the old Windows data +directory to a timestamped backup and leaves it in place; the next start uses a +fresh directory. This intentionally resets the private beta format instead of +silently migrating an old experiment. + The launcher checks published releases and links to their notes. During this unpublished test, follow the supplied test-update instructions rather than switching to a different public channel. diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index f86f0cf33..177d1cdeb 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -113,7 +113,9 @@ the Web page after updating App. If App reports `unsupported_domain_checkpoint`, it has preserved data from an older test format. Keep that data and follow the package's fresh-data instructions; [saved-data settings](../../prototype/channel-server/README.md#saved-data-and-files) explain the separate App and Server directories. Public 2.x downloads are not -the 3.0 test update. +the 3.0 test update. If the beta reports `unsupported_storage_version`, stop +App and run the supplied `reset-beta-app-data.ps1`; it keeps the old App +directory as a timestamped backup. ## Share from an existing site diff --git a/docs/guide/getting-started.zh-CN.md b/docs/guide/getting-started.zh-CN.md index 20c4563a1..743128f59 100644 --- a/docs/guide/getting-started.zh-CN.md +++ b/docs/guide/getting-started.zh-CN.md @@ -97,6 +97,8 @@ `unsupported_domain_checkpoint`,表示已有数据来自更早的测试格式,原数据仍保留。 先留存旧资料,再按包内说明使用新的测试数据;App 与 Server 的独立数据目录见 [数据设置](../../prototype/channel-server/README.md#saved-data-and-files)。公开的 2.x 下载不是本次 3.0 内测更新。 +如果内测 App 提示 `unsupported_storage_version`,请退出 App 后运行随包提供的 +`reset-beta-app-data.ps1`;旧 App 目录会保留为带时间戳的备份。 ## 使用已有站点分享 diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md index 4f21eb309..adbd837d3 100644 --- a/docs/guide/troubleshooting.md +++ b/docs/guide/troubleshooting.md @@ -225,6 +225,15 @@ voice or file transfer fails, check that activity below. A failed or canceled file transfer does not end room chat. Do not clear site storage to retry; that can remove retained files, identity or a Browser-hosted room. +### The beta App reports `unsupported_storage_version` + +This is the expected boundary when a private beta changes its local storage +format. Stop Piik App, keep any room backups, and run the supplied +`reset-beta-app-data.ps1` helper. It renames the old App data directory with a +timestamp and keeps it as a backup; the next start creates a fresh beta directory. +The helper does not migrate or delete the old database. This reset helper is for +the 3.0 internal beta only. + ## Starting a share [No picker](#no-screen-picker) · [Missing windows](#app-windows-or-screens-are-missing) · diff --git a/docs/guide/troubleshooting.zh-CN.md b/docs/guide/troubleshooting.zh-CN.md index 027005af5..4a7cd40b5 100644 --- a/docs/guide/troubleshooting.zh-CN.md +++ b/docs/guide/troubleshooting.zh-CN.md @@ -186,6 +186,12 @@ Piik App 的本地网络邀请使用临时自签名 HTTPS 证书,浏览器可 文件失败或取消不会结束房间聊天。不要为重试清除站点存储,这可能删除保留文件、身份或 Browser 托管的房间。 +### 内测 App 提示 `unsupported_storage_version` + +这是私有内测版本更换本地存储格式时的预期边界。先退出 Piik App,并保存需要的房间备份, +再运行随包提供的 `reset-beta-app-data.ps1`。它会把旧 App 数据目录改名为带时间戳的备份目录, +不会迁移或删除旧数据库;下次启动会创建新的内测数据目录。这个清理脚本只用于 3.0 内测。 + ## 开始分享 [没有选源器](#没有屏幕选择弹窗) · [找不到窗口](#app-找不到窗口或屏幕) · diff --git a/scripts/reset-beta-app-data.ps1 b/scripts/reset-beta-app-data.ps1 new file mode 100644 index 000000000..fe4781adc --- /dev/null +++ b/scripts/reset-beta-app-data.ps1 @@ -0,0 +1,41 @@ +param( + [string]$DataDirectory, + [switch]$Yes +) + +$ErrorActionPreference = "Stop" + +if ([string]::IsNullOrWhiteSpace($DataDirectory)) { + $localAppData = [Environment]::GetFolderPath("LocalApplicationData") + if ([string]::IsNullOrWhiteSpace($localAppData)) { throw "Local application data directory is unavailable." } + $DataDirectory = Join-Path $localAppData "Piik\channel-app" +} + +$appProcesses = @(Get-Process -Name "piik-app", "piik-channel-app" -ErrorAction SilentlyContinue) +if ($appProcesses.Count -gt 0) { + throw "Piik App is still running. Close it normally, then run this script again." +} + +if (-not (Test-Path -LiteralPath $DataDirectory -PathType Container)) { + Write-Host "No App data directory found: $DataDirectory" + exit 0 +} + +$resolvedDataDirectory = (Resolve-Path -LiteralPath $DataDirectory).Path +$parentDirectory = Split-Path -Parent $resolvedDataDirectory +$leaf = Split-Path -Leaf $resolvedDataDirectory +$stamp = [DateTime]::UtcNow.ToString("yyyyMMdd-HHmmssZ") +$backupDirectory = Join-Path $parentDirectory "$leaf.beta-backup.$stamp" + +if (-not $Yes) { + Write-Host "This beta-only action will rename the old data directory and keep it as a backup:" + Write-Host " $resolvedDataDirectory" + Write-Host "→ $backupDirectory" + Write-Host "It does not migrate or delete the old database." + $answer = Read-Host "Type RESET to continue" + if ($answer -cne "RESET") { Write-Host "Cancelled."; exit 1 } +} + +Move-Item -LiteralPath $resolvedDataDirectory -Destination $backupDirectory +Write-Host "Created a fresh beta data directory on the next App start." +Write-Host "Old data kept at: $backupDirectory"