Description
Network.getRequestPostData fails with No post data available unless the client first calls Network.addDataCollector on the target scope. In Chromium, getRequestPostData works out of the box for any request whose body was captured — no collector setup is required.
Steps to Reproduce
moli serve and connect over CDP.
Network.enable, then submit a POST (e.g. a fetch('...', {method:'POST', body:'username=alice&pw=s3cret'}) from a page, or a form POST).
- Observe
Network.requestWillBeSent → the event carries request.postData correctly (event side works). ✅
- Call
Network.getRequestPostData with that request id (command side). ❌ No post data available.
Actual Behavior
- Event side (
requestWillBeSent.request.postData): body available out of the box (verified: "username=alice&pw=s3cret").
- Command side (
Network.getRequestPostData): returns No post data available unless Network.addDataCollector was issued first (moli-protocol/src/domains/network/backlog.rs:891 record_captured_request_body_with_collector_scope gates the read on collector scope).
Expected Behavior
Network.getRequestPostData should return the captured body without requiring the client to know about/invoke addDataCollector, matching Chromium's semantics. Proposal: fall back to the most recent captured body when no collector scope is present.
Impact
Automation clients (Playwright-style tools, network-inspection harnesses) that only call getRequestPostData get a spurious failure even though the body was captured and is visible in the event stream.
Environment
- moli (reproduced on v1.0.2 and HEAD)
- Relevant code:
moli-protocol/src/domains/network/network.rs:265,279, response_body.rs:64,112-113,254, backlog.rs:891
Description
Network.getRequestPostDatafails withNo post data availableunless the client first callsNetwork.addDataCollectoron the target scope. In Chromium,getRequestPostDataworks out of the box for any request whose body was captured — no collector setup is required.Steps to Reproduce
moli serveand connect over CDP.Network.enable, then submit a POST (e.g. afetch('...', {method:'POST', body:'username=alice&pw=s3cret'})from a page, or a form POST).Network.requestWillBeSent→ the event carriesrequest.postDatacorrectly (event side works). ✅Network.getRequestPostDatawith that request id (command side). ❌No post data available.Actual Behavior
requestWillBeSent.request.postData): body available out of the box (verified:"username=alice&pw=s3cret").Network.getRequestPostData): returnsNo post data availableunlessNetwork.addDataCollectorwas issued first (moli-protocol/src/domains/network/backlog.rs:891 record_captured_request_body_with_collector_scopegates the read on collector scope).Expected Behavior
Network.getRequestPostDatashould return the captured body without requiring the client to know about/invokeaddDataCollector, matching Chromium's semantics. Proposal: fall back to the most recent captured body when no collector scope is present.Impact
Automation clients (Playwright-style tools, network-inspection harnesses) that only call
getRequestPostDataget a spurious failure even though the body was captured and is visible in the event stream.Environment
moli-protocol/src/domains/network/network.rs:265,279,response_body.rs:64,112-113,254,backlog.rs:891