moscajs / aedes

Barebone MQTT broker that can run on any stream server, the node way
MIT License
1.78k stars 231 forks source link

[bug] incorrect TypeScript definition for LastHearthbeatTimestamp #803

Open haci-xplora opened 1 year ago

haci-xplora commented 1 year ago

it should be number instead of Date as we are storing Date.now() when a heartbeat message is received:

https://github.com/moscajs/aedes/blob/main/aedes.js#L149

file to be fixed: types/instance.d.ts

type LastHearthbeatTimestamp = Date; // <-- must be number

export interface Brokers {
  [brokerId: string]: LastHearthbeatTimestamp;
}
robertsLando commented 1 year ago

PR?