fix(dispatcher): advance mint counter past caller-supplied IDs (#3126)

Closed
EL
3mo ago
+104-2

Summary

  • When a caller supplies an integer request ID, eagerly advance _next_id to max(_next_id, supplied_id) in both JsonRpcDispatcher and DirectDispatcher
  • Prevents minted IDs from colliding with previously-completed caller-supplied IDs (spec requires IDs MUST NOT be reused within a session)
  • Minimal 2-line fix per dispatcher โ€” no behavioral change for string-only IDs

Test plan

  • 4 new regression tests (2 per dispatcher via pair_factory parametrization)
  • All 894 tests pass
  • Covers both in-flight and completed caller-supplied ID scenarios

Fixes #3126