mirror of https://github.com/openclaw/openclaw.git
diffs: validate hydration language inputs
This commit is contained in:
parent
a39501a4f2
commit
afaa838bed
|
|
@ -29,6 +29,7 @@ Docs: https://docs.openclaw.ai
|
|||
|
||||
### Fixes
|
||||
|
||||
- Diffs: fall back to plain text when `lang` hints are invalid during diff render and viewer hydration, so bad or stale language values no longer break the diff viewer. (#57902) Thanks @gumadeiras.
|
||||
- Image generation/build: write stable runtime alias files into `dist/` and route provider-auth runtime lookups through those aliases so image-generation providers keep resolving auth/runtime modules after rebuilds instead of crashing on missing hashed chunk files.
|
||||
- Config/runtime: pin the first successful config load in memory for the running process and refresh that snapshot on successful writes/reloads, so hot paths stop reparsing `openclaw.json` between watcher-driven swaps.
|
||||
- Config/legacy cleanup: stop probing obsolete alternate legacy config names and service labels during local config/service detection, while keeping the active `~/.openclaw/openclaw.json` path canonical.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -10,14 +10,14 @@ describe("filterSupportedHydrationLanguages", () => {
|
|||
});
|
||||
|
||||
it("drops invalid languages and falls back to text", async () => {
|
||||
await expect(
|
||||
filterSupportedHydrationLanguages(["not-a-real-language" as unknown as "text"]),
|
||||
).resolves.toEqual(["text"]);
|
||||
await expect(filterSupportedHydrationLanguages(["not-a-real-language"])).resolves.toEqual([
|
||||
"text",
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps valid languages when invalid hints are mixed in", async () => {
|
||||
await expect(
|
||||
filterSupportedHydrationLanguages(["typescript", "not-a-real-language" as unknown as "text"]),
|
||||
filterSupportedHydrationLanguages(["typescript", "not-a-real-language"]),
|
||||
).resolves.toEqual(["typescript"]);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const viewerState: ViewerState = {
|
|||
};
|
||||
|
||||
export async function filterSupportedHydrationLanguages(
|
||||
languages: Iterable<SupportedLanguages>,
|
||||
languages: Iterable<string>,
|
||||
): Promise<SupportedLanguages[]> {
|
||||
const supported = new Set<SupportedLanguages>();
|
||||
for (const language of languages) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue