fix(service): show how to reclaim an app data root the service refuses

When the service refuses the app data root because another uid owns it
(code 1012), show a sticky notice with the chown command for this
account. Repairing the service cannot fix this.

Refs #8026
This commit is contained in:
wonfen
2026-09-24 22:10:42 +08:00
parent 04d74ac48f
commit 1f140dfd3a
24 changed files with 97 additions and 3 deletions
+25
View File
@@ -25,6 +25,8 @@ const SERVICE_PERMISSION_NOTICE =
'settings.feedback.notifications.clashService.permissionFallback'
const SERVICE_PERMISSION_GUIDE =
'https://clash-verge-rev.github.io/faq/windows.html#service-core-permissions'
const SERVICE_OWNER_NOTICE =
'settings.feedback.notifications.clashService.appDataNotOwned'
type NoticePosition = NonNullable<IVergeConfig['notice_position']>
type NoticeItem = ReturnType<typeof getSnapshotNotices>[number]
@@ -95,6 +97,26 @@ const resolveNoticeMessage = (
)
}
if (i18n.key === SERVICE_OWNER_NOTICE) {
return (
<>
{t(SERVICE_OWNER_NOTICE)}
<Box
component="code"
sx={{
display: 'block',
mt: 1,
userSelect: 'text',
whiteSpace: 'pre-wrap',
wordBreak: 'break-all',
}}
>
{String(i18n.params?.command ?? '')}
</Box>
</>
)
}
const source = (i18n.params ?? {}) as Record<string, unknown>
// Bound both parameters and their final interpolation.
const params =
@@ -171,6 +193,9 @@ const resolveNoticeCopyText = (
if (notice.i18n?.key === SERVICE_PERMISSION_NOTICE) {
return extractNoticeCopyText(notice.i18n.params?.reason)
}
if (notice.i18n?.key === SERVICE_OWNER_NOTICE) {
return extractNoticeCopyText(notice.i18n.params?.command)
}
if (
notice.i18n?.key === 'shared.feedback.notices.prefixedRaw' ||
notice.i18n?.key === 'shared.feedback.notices.raw'