Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdks/typescript/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to Hatchet's TypeScript SDK will be documented in this chang
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Fixed heartbeat worker logging to ignore Node watch-mode worker reload messages that don鈥檛 match the heartbeat message protocol.

## [1.28.0] - 2026-07-23

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ import path from 'path';
import { runThreaded } from '@hatchet/util/thread-helper';
import { ClientConfig } from '../../hatchet-client';
import { DispatcherClient } from '../dispatcher-client';
import { z } from 'zod/v4';

export interface HeartbeatMessage {
type: 'info' | 'warn' | 'error' | 'debug';
message: string;
}
const HeartbeatMessageSchema = z.object({
type: z.enum(['info', 'warn', 'error', 'debug']),
message: z.string(),
});

export type HeartbeatMessage = z.infer<typeof HeartbeatMessageSchema>;

export const isHeartbeatMessage = (message: unknown): message is HeartbeatMessage =>
HeartbeatMessageSchema.safeParse(message).success;

export const STOP_HEARTBEAT = 'stop';
export class Heartbeat {
Expand Down Expand Up @@ -41,7 +47,11 @@ export class Heartbeat {
},
});

this.heartbeatWorker.on('message', (message: HeartbeatMessage) => {
this.heartbeatWorker.on('message', (message: unknown) => {
if (!isHeartbeatMessage(message)) {
return;
}

this.logger[message.type](message.message);
});
}
Expand Down
Loading