Revert maxDepth/maxElements changes and tests

This commit is contained in:
Huo Yaoyuan committed 2026-11-10 23:41:25 +08:00
1 parent a18dbe9138
commit 176d69bd21
6 files changed
+9 -25

No files matched your search

@@ -113,7 +113,7 @@ it('projects shared controls and macOS signing without adding signing to the sha
for (const field of ['sourceSigning', 'permissionPollIntervalMs', 'agentPreset', 'helperPath']) {
expect(projected.schema.anyOf?.[0]).toHaveProperty(`properties.${field}`)
}
expect(CuaConfig({})).toMatchObject({ maxElements: 5000, maxDepth: 50 })
expect(CuaConfig({})).toMatchObject({ maxElements: 2000, maxDepth: 25 })
expect(NativeProvider.Config({})).toMatchObject({ maxElements: 5000, maxDepth: 50 })
const limits = { maxElements: 100000, maxDepth: 512 }
expect(NativeProvider.Config(limits)).toMatchObject(limits)
@@ -248,12 +248,12 @@
"maxElements": {
"type": "integer",
"minimum": 1,
"maximum": 100000
"maximum": 10000
},
"maxDepth": {
"type": "integer",
"minimum": 1,
"maximum": 512
"maximum": 100
}
},
"required": [
@@ -925,12 +925,12 @@
"maxElements": {
"type": "integer",
"minimum": 1,
"maximum": 100000
"maximum": 10000
},
"maxDepth": {
"type": "integer",
"minimum": 1,
"maximum": 512
"maximum": 100
}
},
"required": [
@@ -23,10 +23,6 @@ it('resolves Windows input defaults without a compiler path setting', () => {
const resolved = Config({})
expect(resolved).not.toHaveProperty('dotnetPath')
expect(resolved.pollIntervalMs).toBe(25)
expect(resolved).toMatchObject({ maxElements: 5000, maxDepth: 50 })
expect(Config({ maxElements: 100000, maxDepth: 512 })).toMatchObject({ maxElements: 100000, maxDepth: 512 })
expect(() => Config({ maxElements: 100001 })).toThrow()
expect(() => Config({ maxDepth: 513 })).toThrow()
expect(resolved.textEventIntervalMs).toBe(0)
expect(() => Config({ pollIntervalMs: 0 })).toThrow()
expect(() => Config({ maxResponseBytes: 2 ** 31 })).toThrow()
+2 -2
View File
@@ -48,6 +48,6 @@ export const CuaConfigFields = {
maxResponseBytes: Schema.number().step(1).min(1024).default(32 * 1024 * 1024),
textEventIntervalMs: Schema.number().min(0).max(1000).default(0.25),
graceMs: Schema.number().step(1).min(1).max(2 ** 31 - 1).default(3000),
maxElements: Schema.number().step(1).min(1).max(100000).default(5000),
maxDepth: Schema.number().step(1).min(1).max(512).default(50),
maxElements: Schema.number().step(1).min(1).max(10000).default(2000),
maxDepth: Schema.number().step(1).min(1).max(100).default(25),
}
+2 -2
View File
@@ -9,8 +9,8 @@ const point = z.number().nonnegative()
const relativePoint = z.number().int().min(0).max(999)
const traversalLimit = z.number().min(1).multipleOf(1)
const nativeTraversalLimits = z.object({
maxElements: z.number().int().min(1).max(100000),
maxDepth: z.number().int().min(1).max(512),
maxElements: z.number().int().min(1).max(10000),
maxDepth: z.number().int().min(1).max(100),
}).strict()
const app = { appHandle: z.string().min(1) }
const pointer = { mouseButton: z.enum(['left', 'right', 'middle']).optional(),
@@ -1044,16 +1044,4 @@ it('forwards bounded traversal limits on a window-only provider', async () => {
expect(f.dispatch).toHaveBeenLastCalledWith({
method: 'getState', params: { appHandle: app.appHandle, windowId: '23', maxDepth: 1, maxElements: 1 },
})
await win.getAccessibilityTree({ maxElements: 7 })
expect(f.dispatch).toHaveBeenLastCalledWith({
method: 'getState', params: { appHandle: app.appHandle, windowId: '23', maxElements: 7 },
})
await win.getAccessibilityTree({ maxDepth: 3 })
expect(f.dispatch).toHaveBeenLastCalledWith({
method: 'getState', params: { appHandle: app.appHandle, windowId: '23', maxDepth: 3 },
})
await win.getAccessibilityTree()
expect(f.dispatch).toHaveBeenLastCalledWith({
method: 'getState', params: { appHandle: app.appHandle, windowId: '23' },
})
})