Most offer/answer bugs are not syntax problems. They are state and sequencing problems.
Question
If WebRTC negotiation fails, what order should I debug SDP offer/answer state?
Quick answer
If negotiation fails, verify this order:
- offer created after tracks are attached,
- local description set before signaling send,
- remote description applied before remote candidates,
- renegotiation events serialized.
High-yield checks
- Confirm you are not sending stale offers during concurrent updates.
- Log SDP direction attributes for each media section.
- Verify both sides apply the same codec expectations.
- Correlate negotiation timestamps with ICE state transitions.
Failure pattern
Teams often chase ICE first when the root issue is an invalid negotiation sequence. Fix signaling order first, then revisit transport.
Negotiation timeline template
Capture this per session:
t0: tracks attached
t1: createOffer
t2: setLocalDescription
t3: offer sent
t4: remote offer received
t5: setRemoteDescription
t6: createAnswer
t7: setLocalDescription(answer)
t8: answer sent
t9+: ICE states (checking/connected/failed)
If timestamps are out of order, fix signaling sequence before touching ICE config.
10-minute action step
- Capture one failing and one successful session log from your signaling layer.
- Trace offer/answer, ICE, and candidate events in strict timestamp order.
- Mark the first divergence point and tie it to one concrete fix.
- Re-test with the same network path and verify behavior is deterministic.
Success signal
You can identify exactly where negotiation broke and prove the same class of failure no longer reproduces.



