Issue type
Public API bug
Severity
Medium
Priority
P2
Affected modules
base-network
Affected files
base-network/src/main/java/build/base/network/Connection.java
base-flow/src/main/java/build/base/flow/Producer.java
Verification status
Source inspection
Problem summary
The publish path treats null as an internal control signal meaning "producer closed." Because of that, callers cannot publish a legitimate null payload even though Producer.publish(T item) does not document null as invalid.
Evidence
publish marks the producer non-operational and removes it when item == null at lines 197-202.
Producer.close() delegates to publish(null) at lines 237-240.
The receiving side treats item == null as stream completion at lines 387-390.
Relevant references
base-network/src/main/java/build/base/network/Connection.java:197
base-network/src/main/java/build/base/network/Connection.java:238
base-network/src/main/java/build/base/network/Connection.java:387
base-flow/src/main/java/build/base/flow/Producer.java:35
Why this matters
The transport conflates control signals with data.
That makes the wire contract surprising and can silently terminate a publish stream when a caller sends null.
Reproduction steps
- Create a producer through
Connection.createProducer.
- Call
publish(null).
- Observe from the code path that the producer is removed locally and the subscriber registry completes remotely.
Expected result
If null payloads are invalid, the API should reject them explicitly.
If null payloads are valid, shutdown should use a distinct control frame rather than overloading payload data.
Actual result
null is silently interpreted as "close the producer."
Suggested fix direction
Use a dedicated operation or frame for producer completion, or reject null with a clear exception at the API boundary.
Acceptance criteria
Publish stream shutdown is represented separately from payload data.
Producer.publish null-handling is documented and tested.
Suggested labels
bug
network
api-behavior
Issue type
Public API bug
Severity
Medium
Priority
P2
Affected modules
base-networkAffected files
base-network/src/main/java/build/base/network/Connection.javabase-flow/src/main/java/build/base/flow/Producer.javaVerification status
Source inspection
Problem summary
The publish path treats
nullas an internal control signal meaning "producer closed." Because of that, callers cannot publish a legitimatenullpayload even thoughProducer.publish(T item)does not documentnullas invalid.Evidence
publishmarks the producer non-operational and removes it whenitem == nullat lines 197-202.Producer.close()delegates topublish(null)at lines 237-240.The receiving side treats
item == nullas stream completion at lines 387-390.Relevant references
base-network/src/main/java/build/base/network/Connection.java:197base-network/src/main/java/build/base/network/Connection.java:238base-network/src/main/java/build/base/network/Connection.java:387base-flow/src/main/java/build/base/flow/Producer.java:35Why this matters
The transport conflates control signals with data.
That makes the wire contract surprising and can silently terminate a publish stream when a caller sends
null.Reproduction steps
Connection.createProducer.publish(null).Expected result
If
nullpayloads are invalid, the API should reject them explicitly.If
nullpayloads are valid, shutdown should use a distinct control frame rather than overloading payload data.Actual result
nullis silently interpreted as "close the producer."Suggested fix direction
Use a dedicated operation or frame for producer completion, or reject
nullwith a clear exception at the API boundary.Acceptance criteria
Publish stream shutdown is represented separately from payload data.
Producer.publishnull-handling is documented and tested.Suggested labels
bugnetworkapi-behavior