Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[FEATURE]: Test that PermissionV2 declines pending requests when its scope closes

Đang mở Phù hợp với người mới
#51,220 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
testing-qa

Hướng nghiên cứu

Bắt đầu trong packages/core/test/permission.test.ts và so sánh test V1 „pending permission rejects on instance dispose“ trong packages/opencode/test/permission/next.test.ts. Xây dựng layer PermissionV2 trong scope Layer.fresh riêng của nó, tạo một request đang chờ, sau đó đóng scope. Hoàn tất khi assert đang chờ thất bại với DeclinedError và list() trả về danh sách rỗng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
210k
Fork
27.8k
Merge trung bình
6 giờ 50 phút
Pull request đã merge (30 ngày)
336

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.