fix(browser): report cancellation after cleanup and source-map abort

An interrupt during CDP cleanup could still publish the captured page, and a source-map download abort was wrapped as a provider failure. Both now return AnalysisCancelledError for the requested operation.
This commit is contained in:
Cursor Agent
2026-10-13 15:56:56 +00:00
parent 855ed9689e
commit d32287ebf6
4 changed files with 147 additions and 10 deletions
+5
View File
@@ -226,6 +226,11 @@ const serveSourceMap = (
response: ServerResponse,
options: FakeOptions,
): boolean => {
if (
options.hangSourceMap === true &&
request.url?.startsWith("/app.js.map") === true
)
return true;
if (options.sourceMapBody === undefined) return false;
if (request.url?.startsWith("/app.js.map") === true) {
if (options.sourceMapRedirect !== undefined)
+2
View File
@@ -93,6 +93,8 @@ export interface FakeOptions {
readonly webSocketWithoutFrames?: boolean;
readonly invalidBinaryWebSocketEvent?: boolean;
readonly sourceMapBody?: string;
/** Accept a source-map request and leave the response open. */
readonly hangSourceMap?: boolean;
readonly sourceMapRedirect?: string;
readonly sessionTimeline?:
| "same_origin"