Skip to content

Commit e5fd1fa

Browse files
committed
Update backend to send correct vapid subject based on stage
1 parent 0bd13e8 commit e5fd1fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

api/abstractplay.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7653,10 +7653,14 @@ async function sendPush(opts: PushOptions) {
76537653
// treat both 410 and 404 as permanent. There are a LOT of 404 web push errors in the logs and apparently these are because since June 2024 the Chrome/FCM push service has changed the way it reports stale or deleted web‑push registrations.
76547654
const PERMANENT_FAILURES = new Set([404, 410]);
76557655

7656+
let subject = "https://play.abstractplay.com";
7657+
if (process.env.WEBSOCKET_STAGE === "dev") {
7658+
subject = "https://play.dev.abstractplay.com";
7659+
}
76567660
try {
76577661
const options: RequestOptions = {
76587662
vapidDetails: {
7659-
subject: 'https://play.abstractplay.com',
7663+
subject,
76607664
publicKey: process.env.VAPID_PUBLIC_KEY as string,
76617665
privateKey: process.env.VAPID_PRIVATE_KEY as string,
76627666
},

0 commit comments

Comments
 (0)