fix(llmodels): stale instances lingering after missed DELETE watch events

This commit is contained in:
jialin
2026-07-23 15:53:21 +08:00
committed by jialin
parent 04511a63a3
commit aca6490da1
3 changed files with 53 additions and 16 deletions
+4 -1
View File
@@ -43,8 +43,11 @@ export const createAxiosToken = (): CancelTokenSource => {
};
export const sliceData = (data: string, loaded: number, loadedSize: any) => {
// `loaded` is a byte count while `data` is a UTF-16 string; with any
// non-ASCII payload the two drift apart, so track consumed characters by
// string length only
const result = data.slice(loadedSize.current);
loadedSize.current = loaded;
loadedSize.current = data.length;
return result;
};