Repository navigation
Description
Description
Smocket's narrowed BroadcastOperator stores its internal volatile flag in a property named volatile. That internal boolean occupies the public API name, so a chain such as io.to(room).volatile does not expose another broadcast operator.
Socket.IO exposes volatile after broadcast narrowing. The correction should separate the private flag from the public operator view and preserve the flag through every supported chain involving to, in, except, and timeout.
The affected public forms include io.to(room).volatile, namespace broadcasts, socket.to(room).volatile, and socket.broadcast.volatile, including supported alternative orderings. Event maps and other public generics must propagate through the returned wrappers.
ADR 0016 already defines Smocket's volatile delivery semantics, so this issue does not reopen when volatile packets are dropped. Exact operator identity, immutability, chain order, and the common Socket.IO 4.7/4.8 surface still need direct verification.
Reproduction
import { connect, Server } from 'smocket';
const URL = 'http://localhost:3000';
const io = new Server(URL);
const client = connect(URL);
const socket = await io.nextConnection();
await socket.join('room');
// Expected: `volatile` is a broadcast operator with emit(), not a boolean flag.
io.to('room').volatile.emit('message', 'hello');
socket.to('room').volatile.emit('message', 'hello');
socket.broadcast.volatile.emit('message', 'hello');Completion requires paired runtime cases across every reachable public form and consumer type fixtures proving that narrowing does not lose event maps.
smocket version
0.4.2
Environment
Node 22, Vitest 4; Socket.IO 4.8.3 reference probe, with Socket.IO 4.7 and 4.8 verification required
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity