From 179ecd0e53a3ee1bcdee4fe14c4b6e6bd9c55fa0 Mon Sep 17 00:00:00 2001 From: AAA <35992542+TNTcraftHIM@users.noreply.github.com> Date: Tue, 24 Nov 2026 20:24:21 -0500 Subject: [PATCH] fix(tools): offer a backup-preserving beta reset entry Add a double-click CMD wrapper for the existing beta reset script. Reuse the running-App check, explicit RESET confirmation and directory backup, and clarify the difference between a full beta profile reset and room attachment cleanup. Validation: actual Windows CMD controls on owned synthetic data cover running-App rejection, cancellation, backup preservation and paths containing spaces, non-ASCII characters and exclamation marks. No actual user profile was reset. The desktop entry is separately bound to the current test profile. --- scripts/reset-beta-app-data.cmd | 9 +++++++++ scripts/reset-beta-app-data.ps1 | 3 ++- src/client/locales/en.ts | 2 +- src/client/locales/zh.ts | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 scripts/reset-beta-app-data.cmd diff --git a/scripts/reset-beta-app-data.cmd b/scripts/reset-beta-app-data.cmd new file mode 100644 index 000000000..758b3e9c9 --- /dev/null +++ b/scripts/reset-beta-app-data.cmd @@ -0,0 +1,9 @@ +@echo off +setlocal EnableExtensions DisableDelayedExpansion +title Piik beta data reset (keeps a backup) +"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%~dp0reset-beta-app-data.ps1" +set "result=%errorlevel%" +echo. +echo Press any key to close. +pause >nul +exit /b %result% diff --git a/scripts/reset-beta-app-data.ps1 b/scripts/reset-beta-app-data.ps1 index e04a3465c..2d095fbd7 100644 --- a/scripts/reset-beta-app-data.ps1 +++ b/scripts/reset-beta-app-data.ps1 @@ -38,7 +38,8 @@ 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." + Write-Host "The next launch starts without this directory's saved sites, App settings, local identities and rooms." + Write-Host "To clear one room's attachments, use Room settings > Records > Clear local room cache." $answer = Read-Host "Type RESET to continue" if ($answer -cne "RESET") { Write-Host "Cancelled."; exit 1 } } diff --git a/src/client/locales/en.ts b/src/client/locales/en.ts index 01a45c550..83374fb2c 100644 --- a/src/client/locales/en.ts +++ b/src/client/locales/en.ts @@ -167,7 +167,7 @@ export const en: Record = { "room.settings.recordsTitle": "Records and backups", "room.settings.clearLocalCache": "Clear local room cache", "room.settings.localCacheScope": "Remove cached attachments for this room and identity on this device.", - "room.settings.confirmClearLocalCache": "Clear your cached attachments for {name} on this device? Room records and saved downloads are kept.", + "room.settings.confirmClearLocalCache": "Clear your cached attachments for {name} on this device? Room records and saved downloads are kept. If this device has the only copy of a file, save it first.", "room.backup.title": "Room backup", "invite.room.title": "Invite to {name}", "invite.room.confirmReset": "Confirm invitation reset", diff --git a/src/client/locales/zh.ts b/src/client/locales/zh.ts index 14dd8a06e..7ef8bbc04 100644 --- a/src/client/locales/zh.ts +++ b/src/client/locales/zh.ts @@ -165,7 +165,7 @@ export const zh = { "room.settings.recordsTitle": "记录与备份", "room.settings.clearLocalCache": "清除本机房间缓存", "room.settings.localCacheScope": "清除当前身份在本机为此房间缓存的附件。", - "room.settings.confirmClearLocalCache": "清除此身份在本机为「{name}」缓存的附件?房间记录和已保存的下载会保留。", + "room.settings.confirmClearLocalCache": "清除此身份在本机为「{name}」缓存的附件?房间记录和已保存的下载会保留。仅在本机有副本的文件,请先保存。", "room.backup.title": "房间备份", "invite.room.title": "邀请进入 {name}", "invite.room.confirmReset": "确认重置邀请",