refactor: block windows app update if the browser is running

This commit is contained in:
zhom
2026-07-20 00:16:49 +04:00
parent a4ed5c855a
commit a71dad735e
24 changed files with 345 additions and 30 deletions
+1 -1
View File
@@ -950,7 +950,7 @@ export default function Home() {
}
} catch (err: unknown) {
console.error("Failed to launch browser:", err);
const errorMessage = err instanceof Error ? err.message : String(err);
const errorMessage = translateBackendError(t, err);
showErrorToast(
t("errors.launchBrowserFailed", { error: errorMessage }),
);
+1 -1
View File
@@ -106,7 +106,7 @@ export function useAppUpdateNotifications() {
showToast({
type: "error",
title: t("appUpdate.toast.restartFailed"),
description: String(error),
description: translateBackendError(t, error),
duration: 6000,
});
}
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "Unsupported rules format: {{format}}",
"dnsRulesSaveFailed": "Failed to save the DNS rules.",
"dnsRulesExportFailed": "Failed to export the DNS rules.",
"fingerprintMatchFailed": "Couldn't match the fingerprint to the proxy."
"fingerprintMatchFailed": "Couldn't match the fingerprint to the proxy.",
"proxySidecarVersionMismatch": "Some Donut Browser files are from different versions. Reinstall the latest update; your profiles will stay safe.",
"updateProfilesRunning": "Stop all running profiles before installing the update.",
"updatePreparationFailed": "Donut Browser could not safely stop a background network process. Restart your computer, then try the update again."
},
"rail": {
"profiles": "Profiles",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "Formato de reglas no compatible: {{format}}",
"dnsRulesSaveFailed": "No se pudieron guardar las reglas DNS.",
"dnsRulesExportFailed": "No se pudieron exportar las reglas DNS.",
"fingerprintMatchFailed": "No se pudo ajustar la huella al proxy."
"fingerprintMatchFailed": "No se pudo ajustar la huella al proxy.",
"proxySidecarVersionMismatch": "Algunos archivos de Donut Browser pertenecen a versiones diferentes. Reinstala la última actualización; tus perfiles permanecerán seguros.",
"updateProfilesRunning": "Detén todos los perfiles en ejecución antes de instalar la actualización.",
"updatePreparationFailed": "Donut Browser no pudo detener de forma segura un proceso de red en segundo plano. Reinicia el equipo y vuelve a intentar la actualización."
},
"rail": {
"profiles": "Perfiles",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "Format de règles non pris en charge : {{format}}",
"dnsRulesSaveFailed": "Échec de l'enregistrement des règles DNS.",
"dnsRulesExportFailed": "Échec de l'exportation des règles DNS.",
"fingerprintMatchFailed": "Impossible d'aligner l'empreinte sur le proxy."
"fingerprintMatchFailed": "Impossible d'aligner l'empreinte sur le proxy.",
"proxySidecarVersionMismatch": "Certains fichiers de Donut Browser proviennent de versions différentes. Réinstallez la dernière mise à jour ; vos profils resteront intacts.",
"updateProfilesRunning": "Arrêtez tous les profils en cours dexécution avant dinstaller la mise à jour.",
"updatePreparationFailed": "Donut Browser na pas pu arrêter en toute sécurité un processus réseau en arrière-plan. Redémarrez lordinateur, puis réessayez la mise à jour."
},
"rail": {
"profiles": "Profils",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "サポートされていないルール形式: {{format}}",
"dnsRulesSaveFailed": "DNS ルールを保存できませんでした。",
"dnsRulesExportFailed": "DNS ルールをエクスポートできませんでした。",
"fingerprintMatchFailed": "フィンガープリントをプロキシに合わせられませんでした。"
"fingerprintMatchFailed": "フィンガープリントをプロキシに合わせられませんでした。",
"proxySidecarVersionMismatch": "Donut Browser のファイルに異なるバージョンが混在しています。最新のアップデートを再インストールしてください。プロファイルはそのまま保持されます。",
"updateProfilesRunning": "アップデートをインストールする前に、実行中のプロファイルをすべて停止してください。",
"updatePreparationFailed": "バックグラウンドのネットワークプロセスを安全に停止できませんでした。コンピューターを再起動してから、もう一度アップデートしてください。"
},
"rail": {
"profiles": "プロファイル",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "지원되지 않는 규칙 형식: {{format}}",
"dnsRulesSaveFailed": "DNS 규칙을 저장하지 못했습니다.",
"dnsRulesExportFailed": "DNS 규칙을 내보내지 못했습니다.",
"fingerprintMatchFailed": "지문을 프록시에 맞추지 못했습니다."
"fingerprintMatchFailed": "지문을 프록시에 맞추지 못했습니다.",
"proxySidecarVersionMismatch": "Donut Browser 파일에 서로 다른 버전이 섞여 있습니다. 최신 업데이트를 다시 설치해 주세요. 프로필은 안전하게 유지됩니다.",
"updateProfilesRunning": "업데이트를 설치하기 전에 실행 중인 모든 프로필을 중지하세요.",
"updatePreparationFailed": "Donut Browser가 백그라운드 네트워크 프로세스를 안전하게 중지하지 못했습니다. 컴퓨터를 다시 시작한 후 업데이트를 다시 시도하세요."
},
"rail": {
"profiles": "프로필",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "Formato de regras não suportado: {{format}}",
"dnsRulesSaveFailed": "Falha ao salvar as regras DNS.",
"dnsRulesExportFailed": "Falha ao exportar as regras DNS.",
"fingerprintMatchFailed": "Não foi possível ajustar a impressão digital ao proxy."
"fingerprintMatchFailed": "Não foi possível ajustar a impressão digital ao proxy.",
"proxySidecarVersionMismatch": "Alguns arquivos do Donut Browser são de versões diferentes. Reinstale a atualização mais recente; seus perfis permanecerão seguros.",
"updateProfilesRunning": "Pare todos os perfis em execução antes de instalar a atualização.",
"updatePreparationFailed": "O Donut Browser não conseguiu encerrar com segurança um processo de rede em segundo plano. Reinicie o computador e tente atualizar novamente."
},
"rail": {
"profiles": "Perfis",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "Неподдерживаемый формат правил: {{format}}",
"dnsRulesSaveFailed": "Не удалось сохранить правила DNS.",
"dnsRulesExportFailed": "Не удалось экспортировать правила DNS.",
"fingerprintMatchFailed": "Не удалось подогнать отпечаток под прокси."
"fingerprintMatchFailed": "Не удалось подогнать отпечаток под прокси.",
"proxySidecarVersionMismatch": "Некоторые файлы Donut Browser относятся к разным версиям. Переустановите последнее обновление — ваши профили останутся в безопасности.",
"updateProfilesRunning": "Остановите все запущенные профили перед установкой обновления.",
"updatePreparationFailed": "Donut Browser не удалось безопасно остановить фоновый сетевой процесс. Перезагрузите компьютер и повторите обновление."
},
"rail": {
"profiles": "Профили",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "Desteklenmeyen kural biçimi: {{format}}",
"dnsRulesSaveFailed": "DNS kuralları kaydedilemedi.",
"dnsRulesExportFailed": "DNS kuralları dışa aktarılamadı.",
"fingerprintMatchFailed": "Parmak izi proxy'ye eşlenemedi."
"fingerprintMatchFailed": "Parmak izi proxy'ye eşlenemedi.",
"proxySidecarVersionMismatch": "Bazı Donut Browser dosyaları farklı sürümlere ait. En son güncellemeyi yeniden yükleyin; profilleriniz güvende kalır.",
"updateProfilesRunning": "Güncellemeyi yüklemeden önce çalışan tüm profilleri durdurun.",
"updatePreparationFailed": "Donut Browser arka plandaki bir ağ işlemini güvenli şekilde durduramadı. Bilgisayarınızı yeniden başlatıp güncellemeyi tekrar deneyin."
},
"rail": {
"profiles": "Profiller",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "Định dạng quy tắc không được hỗ trợ: {{format}}",
"dnsRulesSaveFailed": "Không thể lưu quy tắc DNS.",
"dnsRulesExportFailed": "Không thể xuất quy tắc DNS.",
"fingerprintMatchFailed": "Không thể khớp vân tay với proxy."
"fingerprintMatchFailed": "Không thể khớp vân tay với proxy.",
"proxySidecarVersionMismatch": "Một số tệp Donut Browser thuộc các phiên bản khác nhau. Hãy cài đặt lại bản cập nhật mới nhất; hồ sơ của bạn vẫn được giữ an toàn.",
"updateProfilesRunning": "Hãy dừng tất cả hồ sơ đang chạy trước khi cài đặt bản cập nhật.",
"updatePreparationFailed": "Donut Browser không thể dừng an toàn một tiến trình mạng chạy nền. Hãy khởi động lại máy tính rồi thử cập nhật lại."
},
"rail": {
"profiles": "Profile",
+4 -1
View File
@@ -1870,7 +1870,10 @@
"unsupportedDnsRulesFormat": "不支持的规则格式:{{format}}",
"dnsRulesSaveFailed": "保存 DNS 规则失败。",
"dnsRulesExportFailed": "导出 DNS 规则失败。",
"fingerprintMatchFailed": "无法将指纹匹配到代理。"
"fingerprintMatchFailed": "无法将指纹匹配到代理。",
"proxySidecarVersionMismatch": "部分 Donut Browser 文件来自不同版本。请重新安装最新更新;你的配置文件将保持安全。",
"updateProfilesRunning": "安装更新前,请停止所有正在运行的配置文件。",
"updatePreparationFailed": "Donut Browser 无法安全停止后台网络进程。请重启电脑,然后再次尝试更新。"
},
"rail": {
"profiles": "配置文件",
+9
View File
@@ -36,8 +36,11 @@ export type BackendErrorCode =
| "PROXY_PAYMENT_REQUIRED"
| "VPN_NOT_WORKING"
| "CAMOUFOX_IMPORT_DEPRECATED"
| "PROXY_SIDECAR_VERSION_MISMATCH"
| "UPDATE_CHECKSUMS_UNAVAILABLE"
| "UPDATE_CHECKSUM_MISMATCH"
| "UPDATE_PROFILES_RUNNING"
| "UPDATE_PREPARATION_FAILED"
| "PROFILE_NAME_EXISTS"
| "IMPORT_SOURCE_NOT_FOUND"
| "IMPORT_NO_ITEMS"
@@ -162,6 +165,8 @@ export function translateBackendError(t: TFunction, err: unknown): string {
return t("backendErrors.vpnNotWorking");
case "CAMOUFOX_IMPORT_DEPRECATED":
return t("backendErrors.camoufoxImportDeprecated");
case "PROXY_SIDECAR_VERSION_MISMATCH":
return t("backendErrors.proxySidecarVersionMismatch");
case "UPDATE_CHECKSUMS_UNAVAILABLE":
return t("backendErrors.updateChecksumsUnavailable", {
version: parsed.params?.version ?? "",
@@ -170,6 +175,10 @@ export function translateBackendError(t: TFunction, err: unknown): string {
return t("backendErrors.updateChecksumMismatch", {
file: parsed.params?.file ?? "",
});
case "UPDATE_PROFILES_RUNNING":
return t("backendErrors.updateProfilesRunning");
case "UPDATE_PREPARATION_FAILED":
return t("backendErrors.updatePreparationFailed");
case "PROFILE_NAME_EXISTS":
return t("backendErrors.profileNameExists", {
name: parsed.params?.name ?? "",