| 729 | // matches via the field-path string but whose top-level error is NOT |
| 730 | // the literal "last_update" (avoid the first-strike fire branch). |
| 731 | var ambiguousLastUpdate400 = function () { |
| 732 | var body = JSON.stringify({ |
| 733 | error: 'something_else', |
| 734 | // Note: regex matches "last_update" anywhere in the body, but the |
| 735 | // mentionsLastUpdate first-strike branch ALSO matches it. So this |
| 736 | // case fires on tick 1, not tick 3. To exercise the counter |
| 737 | // specifically we need a path that increments but does not fire. |
| 738 | // No such body exists in the current implementation; this test |
| 739 | // therefore covers the related invariant: a successful 2xx in the |
| 740 | // middle DOES reset the counter when 400s do reach the bump |
| 741 | // branch. We assert this via behaviour rather than internal state. |
| 742 | details: [{ path: ['last_update'] }], |
| 743 | }); |
| 744 | return { |
| 745 | ok: false, status: 400, |
| 746 | json: async () => JSON.parse(body), |
| 747 | text: async () => body, |
| 748 | }; |
| 749 | }; |
| 750 | |
| 751 | _persistLastUpdateStateForTesting({ |
| 752 | to_version: '1.88.0', |