Skip to content

Commit bd527dd

Browse files
Fix: use nodejs20 runtime for Gen1 extension functions
* fix: use nodejs20 runtime for Gen1 extension functions (v0.2.7) Gen1 Cloud Functions fail to deploy with nodejs22 on many Firebase projects. Revert all extension runtimes and package engines to Node 20, which is the supported Gen1 target while auth triggers remain v1-only. Fixes #711 Fixes #787 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): align integration tests with nodejs20 emulator runtime - Pin nodejs20 in emulator firebase configs - Fix callable region (europe-west1) in token-generation tests - Disable Jest watchman for CI stability Co-authored-by: Cursor <cursoragent@cursor.com> * Update ci.yml * fix(ci): harden integration tests for GitHub Actions - Pin emulator project ID and auth/firestore emulator hosts - Use longer sync timeouts when CI=true - Validate extension env files before running integration suite Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): use LOCATION from extension env for callable region Hardcoding europe-west1 broke token-generation when CI ENV_LOCAL uses us-central1. Load env in emulator setup and match getFunctions region. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): run integration tests with Firebase Extensions emulator Auth tests were starting only the functions emulator, so extension env vars never reached Cloud Functions and Stream sync timed out. Start the extensions emulator, drop duplicate functions deploy config, and call ext-auth-chat-getStreamUserToken in the correct LOCATION region. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): route Stream secrets into secret.local for emulator STREAM_API_KEY is a secret param in extension.yaml but CI wrote it to .env.local only, so functions never received credentials. Add prepare-extension-env.js to split secrets, sync into functions/, and run it before validation and each emulator test suite. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent dfccb90 commit bd527dd

29 files changed

Lines changed: 262 additions & 51 deletions

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,26 @@ on:
1212
jobs:
1313
test:
1414
runs-on: ubuntu-latest
15+
env:
16+
CI: true
1517

1618
steps:
1719
- uses: actions/checkout@v4
18-
- name: Use Node.js 22
20+
- name: Use Node.js 20
1921
uses: actions/setup-node@v4
2022
with:
21-
node-version: 22
23+
node-version: 20
2224
- name: Use Java 21
2325
uses: actions/setup-java@v4
2426
with:
2527
distribution: temurin
2628
java-version: 21
29+
- name: Build and unit test auth-chat functions
30+
working-directory: auth-chat/functions
31+
run: |
32+
npm ci
33+
npm run build
34+
npm test
2735
- run: npm ci
2836
working-directory: integration-tests
2937
- name: Generate .env.local and .secret.local files

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
20

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ Stream is the #1 provider for activity feeds and chat APIs, powering over a bill
7474

7575
- [Firebase project](https://firebase.google.com/docs/projects/create) with Blaze (pay-as-you-go) plan
7676
- [Stream account](https://getstream.io/try-for-free/) with API key and secret
77-
- Node.js 22 for local builds and integration tests (`.nvmrc` is included)
77+
- Node.js 20 for local builds and integration tests (`.nvmrc` is included)
7878

7979
### Installation
8080

8181
Each extension can be installed using either the Firebase Console or the Firebase CLI. See individual extension READMEs for detailed installation instructions.
8282

8383
### Runtime Strategy
8484

85-
These extensions now target the `nodejs22` runtime, but they intentionally stay on `firebase-functions/v1`.
85+
These extensions target the `nodejs20` runtime on **1st-gen** Cloud Functions, and intentionally stay on `firebase-functions/v1`.
8686

87-
Firebase Extensions currently treats the trigger types used here as 1st-gen only, so the repo avoids mixing in partial v2 migrations that would create versioning and rollout ambiguity for installed extension instances.
87+
Firebase Extensions deploy these triggers as Gen1 functions. Gen1 does not reliably support `nodejs22` across regions and projects ([issue #711](https://github.com/GetStream/stream-firebase-extensions/issues/711), [#787](https://github.com/GetStream/stream-firebase-extensions/issues/787)). Auth event triggers are not available on Gen2 yet, so we use `nodejs20` rather than a partial Gen2 migration.
8888

8989
## Resources
9090

auth-activity-feeds/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Version 0.2.7
2+
3+
- Revert extension Cloud Functions runtime from `nodejs22` to `nodejs20` for Gen1 compatibility
4+
- Fixes deployment failures on new Firebase projects ([#711](https://github.com/GetStream/stream-firebase-extensions/issues/711), [#787](https://github.com/GetStream/stream-firebase-extensions/issues/787))
5+
16
## Version 0.2.6
27

38
- Add Node v22 engine enforcement to the integration test package

auth-activity-feeds/extension.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: auth-activity-feeds
2-
version: 0.2.6
2+
version: 0.2.7
33
specVersion: v1beta # Firebase Extensions specification version (do not edit)
44

55
displayName: Authenticate with Stream Feeds
@@ -101,21 +101,21 @@ resources:
101101
type: firebaseextensions.v1beta.function
102102
properties:
103103
location: ${LOCATION}
104-
runtime: nodejs22
104+
runtime: nodejs20
105105
eventTrigger:
106106
eventType: providers/firebase.auth/eventTypes/user.create
107107
resource: projects/${PROJECT_ID}
108108
- name: deleteStreamUser
109109
type: firebaseextensions.v1beta.function
110110
properties:
111111
location: ${LOCATION}
112-
runtime: nodejs22
112+
runtime: nodejs20
113113
eventTrigger:
114114
eventType: providers/firebase.auth/eventTypes/user.delete
115115
resource: projects/${PROJECT_ID}
116116
- name: getStreamUserToken
117117
type: firebaseextensions.v1beta.function
118118
properties:
119119
location: ${LOCATION}
120-
runtime: nodejs22
120+
runtime: nodejs20
121121
httpsTrigger: {}

auth-activity-feeds/functions/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auth-activity-feeds/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"logs": "firebase functions:log"
1212
},
1313
"engines": {
14-
"node": "22"
14+
"node": "20"
1515
},
1616
"main": "lib/index.js",
1717
"dependencies": {

auth-chat/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Version 0.2.7
2+
3+
- Revert extension Cloud Functions runtime from `nodejs22` to `nodejs20` for Gen1 compatibility
4+
- Fixes deployment failures on new Firebase projects ([#711](https://github.com/GetStream/stream-firebase-extensions/issues/711), [#787](https://github.com/GetStream/stream-firebase-extensions/issues/787))
5+
16
## Version 0.2.6
27

38
- Add Node v22 engine enforcement to the integration test package

auth-chat/extension.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: auth-chat
2-
version: 0.2.6
2+
version: 0.2.7
33
specVersion: v1beta # Firebase Extensions specification version (do not edit)
44

55
displayName: Authenticate with Stream Chat
@@ -83,27 +83,27 @@ resources:
8383
type: firebaseextensions.v1beta.function
8484
properties:
8585
location: ${LOCATION}
86-
runtime: nodejs22
86+
runtime: nodejs20
8787
eventTrigger:
8888
eventType: providers/firebase.auth/eventTypes/user.create
8989
resource: projects/${PROJECT_ID}
9090
- name: deleteStreamUser
9191
type: firebaseextensions.v1beta.function
9292
properties:
9393
location: ${LOCATION}
94-
runtime: nodejs22
94+
runtime: nodejs20
9595
eventTrigger:
9696
eventType: providers/firebase.auth/eventTypes/user.delete
9797
resource: projects/${PROJECT_ID}
9898
- name: getStreamUserToken
9999
type: firebaseextensions.v1beta.function
100100
properties:
101101
location: ${LOCATION}
102-
runtime: nodejs22
102+
runtime: nodejs20
103103
httpsTrigger: {}
104104
- name: revokeStreamUserToken
105105
type: firebaseextensions.v1beta.function
106106
properties:
107107
location: ${LOCATION}
108-
runtime: nodejs22
108+
runtime: nodejs20
109109
httpsTrigger: {}

auth-chat/functions/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)