fix(protocol): skip non-addressable system face entries

This commit is contained in:
DrSmoothl committed 2026-08-07 21:24:05 +08:00
1 parent 4d958eb984
commit 1646f265ec
3 files changed
+125 -7

No files matched your search

+4 -1
View File
@@ -297,7 +297,10 @@ function validateCatalog(packs: SysFacePackEntry[]): SysFacePackEntry[] {
for (const [faceIndex, face] of pack.emojis.entries()) {
if (!face || typeof face.qSid !== 'string' || !/^(?:0|[1-9]\d*)$/.test(face.qSid)
|| !Number.isSafeInteger(Number(face.qSid)) || Number(face.qSid) < 0) {
throw new Error(`invalid system face id at pack ${packIndex}, face ${faceIndex}`);
throw new Error(
`invalid system face id at pack ${packIndex}, face ${faceIndex}: `
+ `value=${JSON.stringify(face?.qSid)}`,
);
}
if (seen.has(face.qSid)) {
throw new Error(`duplicate system face id ${face.qSid}`);