[FEATURE]: Test that PermissionV2 declines pending requests when its scope closes
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- testing-qa
调研方向
从 packages/core/test/permission.test.ts 开始,并对比 packages/opencode/test/permission/next.test.ts 中的 V1 测试“pending permission rejects on instance dispose”。在其自己的 Layer.fresh 作用域中构建 PermissionV2 层,创建一个待处理请求,然后关闭该作用域。等待中的 assert 以 DeclinedError 失败且 list() 返回空列表,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
PermissionV2 registers a finalizer (packages/core/src/permission.ts, the addFinalizer near the top of the layer) that fails every pending request with DeclinedError and clears the map when the scope closes. Nothing in packages/core/test/permission.test.ts exercises it. The V1 equivalent has a test (pending permission rejects on instance dispose in packages/opencode/test/permission/next.test.ts), so a shutdown that leaked waiters would currently go unnoticed in V2.
I checked the behaviour is correct today. This is only a coverage gap, not a bug: with a request pending, closing the scope makes the waiting assert die with DeclinedError and list() returns empty.
I'd like to add one test for this. It needs the layer built in its own scope with Layer.fresh, since the shared test layer would otherwise hold the finalizer. Happy to send the PR if that's fine.
- 主要语言
- TypeScript
- 星标
- 210k
- 派生
- 27.8k
- 平均合并
- 6 小时 50 分钟
- 30 天内合并 PR
- 336
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#51159 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
priority: P2
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 65/100
prime-radiant-inc/evener#3291 ·
维护者通常 1 天内回复
-
accessibility bug revealjs
难度 2/5 1-3 小时 新手友好度 84/100
quarto-dev/quarto-cli#14961 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
supabase/agent-skills#614 ·
-
Content
难度 2/5 1-3 小时 新手友好度 68/100
RunestoneInteractive/rs#1559 · 1 条评论 ·
维护者通常 2 天内回复