Skip to content

v2.7.0

Choose a tag to compare

@igorzheludkov igorzheludkov released this 05 Aug 21:01
· 140 commits to main since this release

Network mocking — change what the app receives, so its real error code runs

Three new tools. Everything runs in the injected interceptor, and rules live
server-side so they survive reload_app.

  • network_mockreplace returns a canned response before the request
    reaches the wire; tamper fetches the real one on a shadow XHR and mutates it
    via dotted paths (set / remove / bodyReplace). times: N fires a rule a
    limited number of times, so times: 1 reproduces the retry case. url is a
    substring, or a regex when slash-wrapped.
  • network_conditionoffline / slow / normal. offline also patches
    NetInfo when installed, and verifies whether the patch took rather than
    assuming, reporting patched / reads-patched-only / not-installed.
  • network_replay — re-issue a captured request with optional overrides,
    through the app's own network stack.

Mocked traffic is never invisible: rows are tagged [MOCK m1], get_request_details
names the rule and any tamper warning, and every network read carries a banner
while rules are active. Regex patterns are validated server-side, because they
execute in the app's JS thread where catastrophic backtracking would freeze the
app under test.

Tutorial with worked examples: docs/network-mocking.md.

Fixes

  • The XHR interceptor lost a cold-launch race and never retried. On a fresh
    app launch the connect could land before the bundle defined XMLHttpRequest;
    the single retry gave up and left capture dead for the whole run, with no
    error. Now retries for ~10s.
  • Mocked requests were invisible on CDP-capture targets. A mocked request
    never reaches the network, so CDP cannot report it — and the dedupe gate was
    dropping the interceptor's record too.
  • Mock hit counts were stuck at zero whenever the SDK was installed, which
    reads as "the rule never matched".
  • get_logs / get_log_details symbolicate JS stacks.
  • The dev HTTP transport serializes /mcp requests, so overlapping calls no
    longer crash the server.
  • Text input: better targeting guards and field-decorated values.

Testing

The automated suite is unit-only and never drives an attached device. Integration
behaviour is verified by an agent against a running app. 1467 tests.