File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -304,14 +304,30 @@ async function onCreateSendEmail(snap: FirebaseFirestore.DocumentSnapshot, _cont
304304 }
305305}
306306
307+ /**
308+ * Must be the same collection the Angular client writes to (`getRuntimeEnv('FIRESTORE_COLLECTION_MESSAGES')`
309+ * from `src/assets/env.js`, generated by `generate-browser-env.mjs` from `.env`).
310+ * If unset in the Functions runtime, Cloud Functions previously defaulted to `testing`, which caused 0 invocations
311+ * when the app wrote elsewhere. Set `FIRESTORE_COLLECTION_MESSAGES` in Firebase (or `.env` for emulators) if you use a different name.
312+ */
307313const firestoreMessagesCollection =
308- String ( process . env [ 'FIRESTORE_COLLECTION_MESSAGES' ] ?? '' ) . trim ( ) || 'testing' ;
314+ String ( process . env [ 'FIRESTORE_COLLECTION_MESSAGES' ] ?? '' ) . trim ( ) ||
315+ 'messages_new_after_migration' ;
316+
317+ functions . logger . info ( 'contactFormFunction: configured Firestore trigger' , {
318+ documentPath : `${ firestoreMessagesCollection } /{messageId}` ,
319+ envOverride : ! ! String ( process . env [ 'FIRESTORE_COLLECTION_MESSAGES' ] ?? '' ) . trim ( ) ,
320+ } ) ;
309321
310322export const angularUniversalFunction = functions
311323 . region ( 'europe-west3' )
312324 . https . onRequest ( app ) ;
313325
314- /** Any document ID — client uses `.add()` (auto IDs), not email as document ID. */
326+ /**
327+ * Region must match your **Firestore database** location (not necessarily the same as the HTTPS SSR function).
328+ * Default US Firestore (nam5) → `us-central1` triggers. EU DB (eur3) → use an EU region from Firebase’s table.
329+ * Keeping SSR in `europe-west3` and this trigger in `us-central1` is valid when the DB is US and you want EU edge for HTTP only.
330+ */
315331export const contactFormFunction = functions
316332 . region ( 'us-central1' )
317333 . firestore
You can’t perform that action at this time.
0 commit comments