Fix UnifiedPush register race where a late UNREGISTER wiped the new endpoint.
All checks were successful
Build / increment-version (push) Successful in 4s
Build / build-android (push) Successful in 5m8s

This commit is contained in:
2026-07-28 01:38:04 +10:00
parent 725b3467d3
commit a744e36fb1
5 changed files with 129 additions and 16 deletions

View File

@@ -171,6 +171,7 @@ type PushStatus = {
distributor: string;
endpoint: string;
distributors: string[];
lastFailure: string;
};
/** Android-only section showing UnifiedPush registration status and controls. */
@@ -194,6 +195,7 @@ function AndroidPushNotifications() {
distributor: s.distributor || '',
endpoint: s.endpoint || '',
distributors,
lastFailure: s.lastFailure || '',
}
: undefined
);
@@ -211,7 +213,7 @@ function AndroidPushNotifications() {
await refresh();
if (!result.success) {
setLastError(
'Could not register a push distributor. Install ntfy (with UnifiedPush enabled), then try Reset again.'
'Selected distributor but did not get a push endpoint. In ntfy: enable UnifiedPush, allow unrestricted battery, then try Reset again.'
);
}
}, [refresh])
@@ -244,6 +246,13 @@ function AndroidPushNotifications() {
</Text>
);
}
if (status.lastFailure) {
return (
<Text as="span" style={{ color: color.Critical.Main }} size="T200">
{`Registration failed (${status.lastFailure}). Tap Reset and pick ntfy again.`}
</Text>
);
}
if (status.distributors.length === 0) {
return (
<Text as="span" style={{ color: color.Critical.Main }} size="T200">