Version
"@midscene/playground": "^1.8.4"
"@midscene/android": "^1.8.4"
"@midscene/shared": "^1.8.4"
Details
Details
When calling the /execute endpoint, the playground server constructs a response with dump and reportHTML fields that include base64-inlined screenshots (inlineScreenshots: true). After a case with multiple actions executes, the response object becomes extremely large (>50MB), causing JSON.stringify to throw RangeError: Invalid string length inside ServerResponse.json().
Stack trace:
RangeError: Invalid string length
at JSON.stringify ()
at ServerResponse.json
at .../dist/lib/server.js:774-783
Root cause found in source code:
node_modules/@midscene/playground/dist/lib/server.js lines 774-783:
const dumpString = agent.dumpDataString({
inlineScreenshots: true
});
// ...
response.reportHTML = agent.reportHTMLString({
inlineScreenshots: true
});
inlineScreenshots: true is hardcoded, not configurable via request parameters. Even when sending screenshotIncluded: false in the request body, the dump and reportHTML fields still embed base64 screenshots, making the response grow linearly with the number of executed actions.
Reproduce link
Related issues #1439 (same error, closed without fix)
Reproduce Steps
Any /execute call with a case that performs many actions (e.g., multiple swipe operations) will eventually trigger this error as the dump field accumulates screenshot data.
Version
Details
Details
When calling the /execute endpoint, the playground server constructs a response with dump and reportHTML fields that include base64-inlined screenshots (inlineScreenshots: true). After a case with multiple actions executes, the response object becomes extremely large (>50MB), causing JSON.stringify to throw RangeError: Invalid string length inside ServerResponse.json().
Stack trace:
RangeError: Invalid string length
at JSON.stringify ()
at ServerResponse.json
at .../dist/lib/server.js:774-783
Root cause found in source code:
node_modules/@midscene/playground/dist/lib/server.js lines 774-783:
const dumpString = agent.dumpDataString({
inlineScreenshots: true
});
// ...
response.reportHTML = agent.reportHTMLString({
inlineScreenshots: true
});
inlineScreenshots: true is hardcoded, not configurable via request parameters. Even when sending screenshotIncluded: false in the request body, the dump and reportHTML fields still embed base64 screenshots, making the response grow linearly with the number of executed actions.
Reproduce link
Related issues #1439 (same error, closed without fix)
Reproduce Steps
Any /execute call with a case that performs many actions (e.g., multiple swipe operations) will eventually trigger this error as the dump field accumulates screenshot data.