Stop notifications after removing a host (#3176)
* fix(notifications): stop pushes after host removal Push tokens were persisted indefinitely with no relationship to app pairing state. Give registrations a 48-hour renewable lease so offline unpairing converges, and revoke immediately when the host is reachable. * fix(notifications): make token revocation bounded and durable
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { revokeSubscription, startSubscription } from "./internal/subscriptions";
|
||||
import type { RevokePushNotificationsInput, StartPushNotificationsInput } from "./internal/types";
|
||||
|
||||
export function startPushNotifications(input: StartPushNotificationsInput): () => void {
|
||||
return startSubscription(input);
|
||||
}
|
||||
|
||||
export function revokePushNotifications(input: RevokePushNotificationsInput): Promise<void> {
|
||||
return revokeSubscription(input).catch((error) => {
|
||||
console.warn("[PushNotifications] Failed to remove local push subscription", error);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user