@@ -49,7 +49,7 @@ export const setupEventChannel = () => {
49
49
* @returns A Promise resolving when both events are published.
50
50
*/
51
51
export const recordStartEvent = async ( data : string | object ) => {
52
- if ( ! eventChannel ) return ;
52
+ if ( ! eventChannel ) return Promise . resolve ( ) ; // Explicitly return a resolved Promise
53
53
54
54
const eventTypes = getEventTypes ( "onStart" ) ;
55
55
@@ -72,7 +72,7 @@ export const recordStartEvent = async (data: string | object) => {
72
72
* @returns A Promise resolving when both events are published.
73
73
*/
74
74
export const recordErrorEvent = async ( err : Error , subject ?: string ) => {
75
- if ( ! eventChannel ) return ;
75
+ if ( ! eventChannel ) return Promise . resolve ( ) ; // Ensure consistent return type
76
76
77
77
const eventTypes = getEventTypes ( "onError" ) ;
78
78
@@ -103,7 +103,7 @@ export const recordSuccessEvent = async ({
103
103
subject : string ;
104
104
data : string | object ;
105
105
} ) => {
106
- if ( ! eventChannel ) return ;
106
+ if ( ! eventChannel ) return Promise . resolve ( ) ; // Explicitly return a resolved Promise
107
107
108
108
const eventTypes = getEventTypes ( "onSuccess" ) ;
109
109
@@ -126,7 +126,7 @@ export const recordSuccessEvent = async ({
126
126
* @returns A Promise resolving when both events are published.
127
127
*/
128
128
export const recordCompletionEvent = async ( data : string | object ) => {
129
- if ( ! eventChannel ) return ;
129
+ if ( ! eventChannel ) return Promise . resolve ( ) ; // Ensure consistent return type
130
130
131
131
const eventTypes = getEventTypes ( "onCompletion" ) ;
132
132
0 commit comments