My agentic slop goes here. Not intended for anyone else!

JMAP Testing Status#

Current Status#

✅ Completed#

  • Session parsing (jmap-core/jmap_session.ml)
  • Request parsing and serialization (jmap-core/jmap_request.ml)
  • Invocation parsing and serialization (jmap-core/jmap_invocation.ml)
  • JMAP client with Eio integration (jmap-client/)
  • API key configuration and loading

⚠️ Known Issue: TLS Connection Reuse#

Problem: The Requests library has a bug where making multiple HTTPS requests with the same Requests instance causes a TLS error on the second request:

Fatal error: exception TLS failure: unexpected: application data

Reproduction:

let requests = Requests.create ~sw env in
let resp1 = Requests.get requests "https://api.fastmail.com/jmap/session" in
(* Drain body *)
let resp2 = Requests.get requests "https://api.fastmail.com/jmap/session" in
(* ^ Fails with TLS error *)

Impact: The first HTTP request (session fetch) works fine, but any subsequent requests fail.

Root Cause: Issue in Requests library's connection pooling or TLS state management when reusing connections.

Workaround Options:

  1. Create a new Requests instance for each request (inefficient)
  2. Fix the Requests library's TLS connection handling
  3. Disable connection pooling if that option exists

Test Case: jmap/test/test_simple_https.ml demonstrates the issue

Test Results#

test_fastmail.exe#

  • ✅ Session parsing works
  • ✅ First HTTPS request succeeds
  • ❌ Second HTTPS request fails with TLS error
  • Status: Blocked on Requests library bug

What Works#

  • Eio integration ✅
  • Session fetching and parsing ✅
  • Request building ✅
  • JSON serialization/deserialization ✅
  • API key loading ✅
  • Authentication headers ✅

What's Blocked#

  • Making JMAP API calls (requires multiple HTTPS requests)
  • Email querying
  • Full end-to-end testing

Next Steps#

  1. Fix TLS connection reuse in Requests library
  2. Implement Response.Parser.of_json once requests work
  3. Complete end-to-end test with email querying