Live Activity Refresh Delay

Nucleic-Session: 8C954A45-A16B-4E91-B9E6-9865809096D7
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 01:37:01 -07:00
co-authored by nucleic
parent 23637a2f6a
commit 2dba30538a
+1
View File
@@ -98,6 +98,7 @@ export async function registerPushToken(
if (!body?.deviceId || !body.token) return new Response("deviceId and token required", { status: 422 });
const apsEnv = body.env === "production" ? "production" : "sandbox";
const record: PushTokenRecord = { token: body.token, env: apsEnv, hostId };
if (body.topic) record.topic = body.topic;
await kv.put(body.deviceId, JSON.stringify(record), { expirationTtl: PUSH_TOKEN_TTL });
const auth = await kv.get(`hostauth:${hostId}`);
if (auth) await kv.put(`hostauth:${hostId}`, auth, { expirationTtl: HOST_AUTH_TTL });