fix(housekeeping): count preference payload bytes
This commit is contained in:
1 parent
4e0bf598ed
commit
60968409aa
3 files changed
+28
-2
No files matched your search
@@ -45,7 +45,7 @@ export const housekeepingPreferencesSchema: z.ZodType<HousekeepingPreferences> =
|
||||
.strict()
|
||||
.superRefine((preferences, context) => {
|
||||
if (
|
||||
JSON.stringify(preferences).length >
|
||||
new TextEncoder().encode(JSON.stringify(preferences)).byteLength >
|
||||
HOUSEKEEPING_PREFERENCE_MAX_SERIALIZED_BYTES
|
||||
) {
|
||||
context.addIssue({
|
||||
|
||||
Reference in new issue
Block a user