Skip to content

Commit aa614f5

Browse files
committed
fix(firestore-bigquery-export): update event types for Eventarc compatibility (#1981)
1 parent 5a9311b commit aa614f5

File tree

1 file changed

+4
-4
lines changed
  • firestore-bigquery-export/functions/src

1 file changed

+4
-4
lines changed

firestore-bigquery-export/functions/src/events.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const setupEventChannel = () => {
4949
* @returns A Promise resolving when both events are published.
5050
*/
5151
export const recordStartEvent = async (data: string | object) => {
52-
if (!eventChannel) return;
52+
if (!eventChannel) return Promise.resolve(); // Explicitly return a resolved Promise
5353

5454
const eventTypes = getEventTypes("onStart");
5555

@@ -72,7 +72,7 @@ export const recordStartEvent = async (data: string | object) => {
7272
* @returns A Promise resolving when both events are published.
7373
*/
7474
export const recordErrorEvent = async (err: Error, subject?: string) => {
75-
if (!eventChannel) return;
75+
if (!eventChannel) return Promise.resolve(); // Ensure consistent return type
7676

7777
const eventTypes = getEventTypes("onError");
7878

@@ -103,7 +103,7 @@ export const recordSuccessEvent = async ({
103103
subject: string;
104104
data: string | object;
105105
}) => {
106-
if (!eventChannel) return;
106+
if (!eventChannel) return Promise.resolve(); // Explicitly return a resolved Promise
107107

108108
const eventTypes = getEventTypes("onSuccess");
109109

@@ -126,7 +126,7 @@ export const recordSuccessEvent = async ({
126126
* @returns A Promise resolving when both events are published.
127127
*/
128128
export const recordCompletionEvent = async (data: string | object) => {
129-
if (!eventChannel) return;
129+
if (!eventChannel) return Promise.resolve(); // Ensure consistent return type
130130

131131
const eventTypes = getEventTypes("onCompletion");
132132

0 commit comments

Comments
 (0)