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:39:50 -07:00
co-authored by nucleic
parent 1746238050
commit b8baa7ec8a
+11 -5
View File
@@ -189,11 +189,17 @@ export class Room implements DurableObject {
if (me?.deviceId && typeof msg.pushToken === "string") {
const env = msg.env === "production" ? "production" : "sandbox";
const hostId = `room:${this.state.id.toString()}`;
await this.env.NUCLEIC_PUSH_TOKENS.put(
me.deviceId,
JSON.stringify({ token: msg.pushToken, env, hostId }),
{ expirationTtl: 90 * 24 * 60 * 60 },
);
// Per-channel builds have suffixed bundle ids; store the phone's topic so `wake`
// addresses APNs correctly (omitted → the wake falls back to the configured topic).
const record: { token: string; env: string; topic?: string; hostId: string } = {
token: msg.pushToken,
env,
hostId,
};
if (typeof msg.topic === "string" && msg.topic) record.topic = msg.topic;
await this.env.NUCLEIC_PUSH_TOKENS.put(me.deviceId, JSON.stringify(record), {
expirationTtl: 90 * 24 * 60 * 60,
});
}
break;
}