Browse: keep a proven last page when the record count arrives or shrinks, not only when it's unchanged

Đang mở Phù hợp với người mới
#1,963 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 2 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
72/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
frontend

Hướng nghiên cứu

Bắt đầu với kiểm tra bằng chứng trang cuối trong DatabaseTableView.tsx, nơi trang cuối đã ghi nhớ bị loại bỏ bất cứ khi nào số lượng bản ghi khác với số lượng mà nó đã được chứng minh. Đọc cách Next sử dụng bằng chứng đó, sau đó thêm kiểm thử cho ba trường hợp số lượng: lần đầu truy cập, tăng và giảm. Hoàn thành khi bằng chứng được giữ lại ở lần đầu truy cập và khi giảm, bị loại bỏ khi tăng, và mỗi trường hợp đều được bao phủ bởi một kiểm thử.

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

Mô tả

What happens

After #1958, Browse remembers that a page is the last one only while the table's record count is the same as when that was proven. A count that moves lets Next probe past it again, which is what fixes #1940.

The rule is strict equality, so a remembered last page is also dropped when nothing new could be past it:

  • The count first arrives. The proof was made before the count was known, and the count then loads.
  • The count shrinks. Records were deleted, so a page that was last is still last, or now past the end.

Either way the next step costs one extra probe of the page after it. That probe comes back empty and proves the last page again. Nothing is shown wrongly and Next still works, so it's one wasted read, not a bug the user sees.

Possible improvement

Only retire the proof when the count grows: keep it when the count first arrives, or when it shrinks. It's a small change to the proof check in DatabaseTableView.tsx, and needs a test for each of the three cases.

Low priority: the cost is one read per step after a deletion or an initial count load.

Review-Deferral: a3b75b0e1d3e87f1 severity=nit category=correctness

Raised by the cross-model review of #1958 (#1940).

🤖 Generated by Anthropic Claude Code (Claude Opus 5.5); posted via @dawsontoth.

Ngôn ngữ chính
TypeScript
Star
5
Fork
4
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
144

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 HarperFast/studio

Tất cả issue của HarperFast/studio

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.