Skip to content

Truthful transmissions

Latest

Choose a tag to compare

@RomainLanz RomainLanz released this 24 Jan 15:54
df61420

Breaking Changes

Removed subscribe/unsubscribe transport synchronization

The transport layer no longer broadcasts subscribe/unsubscribe events across instances. Previously, when a client subscribed or unsubscribed on one server instance, other instances were notified via the transport bus. This behavior has been removed as it was unused.

Default broadcast payload changed from {} to null

When calling broadcast without a payload, the default value is now null instead of an empty object {}.

// Before
transmit.broadcast('channel')  // sent { payload: {} }

// After
transmit.broadcast('channel')  // sends { payload: null }

Bug Fixes

Preserve falsy payload values in broadcast (Breaking)

Broadcasting falsy values like 0, false, '', or null now works correctly. Previously, these values were incorrectly converted to an empty object {}.

// Before: All these would send { payload: {} }
transmit.broadcast('channel', 0)
transmit.broadcast('channel', false)
transmit.broadcast('channel', '')
                                         
// After: Values are preserved correctly
transmit.broadcast('channel', 0)      // sends { payload: 0 }
transmit.broadcast('channel', false)  // sends { payload: false }
transmit.broadcast('channel', '')     // sends { payload: '' }

Fixed onSubscribe callback behavior

The onSubscribe callback is now only called when the subscription actually succeeds. Previously, it could be called even when the stream UID didn't exist, which could lead to inconsistent state in application code.