A capability stays maintainable only when the team can explain every state, retry, and piece of residual data—not merely show one successful run. Control decides whether work continues and resources are released, so it outranks another chunk. Multiple DataChannels may still share one SCTP association; bulk queues must remain bounded.
File transfer must reconcile sender offsets, durable receiver writes, chunk integrity, and terminal state on both peers. A full progress bar may show queued bytes, not a complete usable file.
Questions the design must answer
List non-negotiable invariants before selecting performance knobs. Tuning can roll out gradually; identity, permission, and terminal-state rules cannot drift at runtime.
- Keep control reliable, ordered, and small; use unordered or partial reliability for bulk only when negotiated.
- Route every send through a priority scheduler that gives control a slot in every round.
- Aggregate acknowledgements with a maximum delay to avoid both ACK storms and stalled windows.
Separate channels are not enough. One bounded scheduler must let control preempt, keep bulk progressing, and converge quickly after either peer cancels.
Edge cases are part of the feature
An abnormal path is more than an error banner. It decides how in-flight work stops, how the peer learns the outcome, what residue remains, and whether the next operation inherits it.
- Two channels call send independently, letting the bulk loop fill the shared browser buffer anyway.
- Cancel changes local UI without a reliable task-ID message and peer acknowledgement.
- Unlimited control priority lets heartbeat and ACK traffic starve bulk forever.
Prove that it works with evidence
Do not stop verification when the final action succeeds. Count side effects, measure wait time, inspect privacy, and prove the next run begins from a clean baseline.
- At bulk high water, send cancel, chat, and pause; assert a bounded end-to-end delay.
- Create ACK bursts and heartbeat storms while proving bulk retains a minimum service rate.
- Interop with a single-channel legacy peer and preserve priority within that one channel.
The release bar is clear: users understand the current state, failures stop or recover, resources stay bounded, and operators can identify the phase from minimum necessary evidence.