Verify cross-task dirty buffer safety after a refused rollback

Đang mở
#2,436 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 3 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
43/100
Loại issue
Lỗi
Độ 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
desktop, testing-qa

Hướng nghiên cứu

Start with src/core/Task.ts, src/core/tools/WriteToFileTool.ts, and src/integrations/editor/DiffViewProvider.ts, then trace task disposal and document opening. Add a two task test that records the dirty buffer and persisted contents before and after task B opens the shared path, and checks whether unapproved streamed content was saved. If the test confirms the risk, cover protection, recovery, and cleanup; otherwise document why the real document lifecycle prevents it.

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

Mô tả

Summary

Investigate whether a later task can save unapproved streamed content after a prior task's rollback fails and the prior task is disposed.

The earlier review found that a rollback failure could leave a dirty document open, and that a later DiffViewProvider.open() could save a dirty document. This cross-task risk predates PR #1930; it has not been verified with a two-task test. PR #1930 does not contain the disposal release discussed below.

The requester identifies the later stacked unit, PR #2435, as the relevant place to assess the disposal drop. At commit 4baf005673f482d9d911de87ff0890644765193a, src/core/task/Task.ts calls writeToFileTool.releaseTaskRollbackFailure(this) during disposal, and src/core/tools/WriteToFileTool.ts defines the release. src/integrations/editor/DiffViewProvider.ts manages the editor buffer and its opening and rollback behavior.

Required work

  • Add a test with two distinct tasks that share a document. Make task A's rollback fail or be refused, keep the document dirty, and dispose task A. Then have task B open the same path.
  • Check whether task B saves the unapproved streamed content before approval. Use a document double or extension-host coverage that preserves the dirty state across task disposal.
  • If the test confirms the risk, add protection at the appropriate cross-task boundary and a regression test. Do not retain a disposed task solely to keep a per-task marker alive. Keep protection until safe recovery or an explicit user decision makes it unnecessary.

Acceptance criteria

  • The test records the buffer and persisted contents before and after task B opens the path, and distinguishes unapproved streamed content from the original content.
  • The test demonstrates that task B cannot silently persist unapproved content before approval, or documents why the scenario cannot occur with the real document lifecycle.
  • If a fix is required, tests cover recovery and cleanup of its protection without retaining disposed task state.

Context

Ngôn ngữ chính
TypeScript
Star
2k
Fork
301
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
103

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 Zoo-Code-Org/Zoo-Code

Tất cả issue của Zoo-Code-Org/Zoo-Code

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.