@@ -49,7 +49,7 @@ export const setupEventChannel = () => {
4949 * @returns A Promise resolving when both events are published.
5050 */
5151export 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 */
7474export 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 */
128128export 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