fix(runtime): isolate unique 8177 repairs (#8298)

This commit is contained in:
backryun
2026-07-24 21:35:10 +09:00
committed by GitHub
parent 0b68fd353f
commit b84f86ad4f
6 changed files with 22 additions and 18 deletions

View File

@@ -241,16 +241,27 @@ test("muse-spark-web: fetch failures do not expose stack traces or source paths"
__resetMuseSparkConversationCacheForTesting();
const executor = new MuseSparkWebExecutor();
const originalFetch = globalThis.fetch;
const errorLogs: string[] = [];
globalThis.fetch = async () => {
throw new Error("socket failed at /srv/omniroute/secrets.ts:42\n at fetchGraphql");
};
try {
const result = await executor.execute(withConnection("conn-fetch-error"));
const result = await executor.execute(
withConnection("conn-fetch-error", {
log: {
error(_tag, message) {
errorLogs.push(message);
},
},
})
);
assert.equal(result.response.status, 502);
const body = await result.response.json();
assert.equal(body.error.message, "Warmup fetch failed: socket failed at <path>");
assert.doesNotMatch(body.error.message, /secrets\.ts|fetchGraphql|\n/);
assert.deepEqual(errorLogs, ["Warmup failed: Warmup fetch failed: socket failed at <path>"]);
assert.doesNotMatch(errorLogs[0], /secrets\.ts|fetchGraphql|\n/);
} finally {
globalThis.fetch = originalFetch;
}

View File

@@ -35,4 +35,10 @@ test("#8135: sqljsAdapter must not statically resolve sql.js at build time", ()
source.includes("/* webpackIgnore: true */"),
"sqljsAdapter dynamic import should include /* webpackIgnore: true */ magic comment"
);
// sql.js does not export ./package.json. Resolving its public entrypoint is
// sufficient to locate the adjacent WASM asset and avoids repeated bundler
// diagnostics for the private package metadata subpath.
assert.match(source, /_require\.resolve\(["']sql\.js["']\)/);
assert.doesNotMatch(source, /sql\.js\/package\.json/);
});