mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-15 19:52:50 +03:00
fix(runtime): isolate unique 8177 repairs (#8298)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user