From 26f6305165067a0bb520b7a0bda194864b42fd1e Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Tue, 7 May 2024 10:47:21 -0400 Subject: [PATCH 1/3] fix: reject channel.follow v1 (#1242) --- functions/src/eventsub.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/functions/src/eventsub.ts b/functions/src/eventsub.ts index 0ea47a7a..0e14f29d 100644 --- a/functions/src/eventsub.ts +++ b/functions/src/eventsub.ts @@ -138,6 +138,12 @@ export const eventsub = functions.https.onRequest(async (req, res) => { return; } else if (status === "enabled") { const type = req.body?.subscription?.type as EventsubType; + const version = req.body?.subscription?.version as string; + + if (type === EventSubType.ChannelFollow && version === "1") { + console.log("rejecting channel.follow v1"); + return; + } const channelId = `twitch:${ req.body.event["broadcaster_user_id"] ?? From 67c34dda11a7f8afb4adb173e1b90014f4bf9424 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Tue, 7 May 2024 19:58:17 -0700 Subject: [PATCH 2/3] fix: incorrect variable name --- functions/src/eventsub.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/src/eventsub.ts b/functions/src/eventsub.ts index 0e14f29d..2e75712e 100644 --- a/functions/src/eventsub.ts +++ b/functions/src/eventsub.ts @@ -140,7 +140,7 @@ export const eventsub = functions.https.onRequest(async (req, res) => { const type = req.body?.subscription?.type as EventsubType; const version = req.body?.subscription?.version as string; - if (type === EventSubType.ChannelFollow && version === "1") { + if (type === EventsubType.ChannelFollow && version === "1") { console.log("rejecting channel.follow v1"); return; } From f51d223a628fb723adba07f68dc3aff9903830a6 Mon Sep 17 00:00:00 2001 From: SputNikPlop <100245448+SputNikPlop@users.noreply.github.com> Date: Tue, 7 May 2024 20:00:05 -0700 Subject: [PATCH 3/3] fix: upgrade node version (#1243) --- .github/workflows/firebase-functions-pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/firebase-functions-pull-request.yml b/.github/workflows/firebase-functions-pull-request.yml index 1399a9fe..eaa4c26d 100644 --- a/.github/workflows/firebase-functions-pull-request.yml +++ b/.github/workflows/firebase-functions-pull-request.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js 16 + - name: Use Node.js 18 uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - run: npm ci && npm run build working-directory: functions