Docs cache: two call sites can still share a key through a helper's url parameter

Đang mở
#751 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading src/server/providers/docs-cache-keys.test.ts (the guard from #744) and the cached-parse path in src/server/providers/google-docs.ts, especially the miss path that skips the JSON round-trip. Then trace every call site that builds a docs-cache key and find ones where a helper takes a url parameter, since those are the shapes the current test cannot distinguish. Decide between per-parse names in the key or schema-validated reads, and make the acceptance test cache two shapes at one URL and assert a reported miss rather than a TypeError.

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

Mô tả

Problem

The BytePlus poll failed for 1h45 on 2026-11-21 because two parsers cached different shapes under one docs-cache key (#744). The guard added there, src/server/providers/docs-cache-keys.test.ts, compares key expressions as written: it cannot see two constants holding the same URL, or a helper that takes a url parameter. cachedGoogleDocs (google-docs.ts) also has its own miss path with no JSON round-trip.

Ask

Make a collision impossible, not just tested: for example have each cached parse declare a name that goes into the key, or validate the cached shape on read with the parser's own schema and treat a mismatch as a miss that is reported.

Acceptance

  • A test that caches two shapes at one URL through a helper fails loudly at the read, not with a TypeError in the caller.
Ngôn ngữ chính
TypeScript
Star
0
Fork
1
Merge trung bình
5 giờ 40 phút
Pull request đã merge (30 ngày)
193

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 TanStack/schemas

Tất cả issue của TanStack/schemas

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.