feat(json_client): headers param on JsonClient.get — If-None-Match → 304 conditional reads
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start by reading campus_python/json_client/interface.py and trace JsonClient.get through its concrete implementations and test doubles named in the issue, including CampusRequest. The proposal also mentions Files.get_content, BySlugCollection.get_content, and Files.File.get_content; check their tests before deciding the scope. Done means conditional requests can send If-None-Match and handle 304 as described, with the affected implementations and tests updated.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Deferred from #125 / PR #164: campus.api /files content responses (by-slug and by-id) emit an ETag ({size}-{updated_at}) and honor If-None-Match with 304 Not Modified, but the SDK cannot send conditional requests — JsonClient.get(path, query=None) has no headers parameter.
Proposal
- Add
headers: Mapping[str, str] | None = NonetoJsonClient.get(and, if wanted, the other verbs) incampus_python/json_client/interface.py. Files.get_content/BySlugCollection.get_content/Files.File.get_contentcould then accept anetagparam: sendIf-None-Match, and on 304 returnNone(caller keeps its cached copy) instead of raising.
Why not now
A signature change on the client ABC ripples into every concrete implementation and test double fleet-wide (CampusRequest, the campus-suite TestCampusRequest, nyxchange/classroom/admin doubles). Content responses already carry max-age=60, so plain HTTP-layer caching works today; conditional revalidation is a nice-to-have that deserves its own coordinated change.
Refs: #125, #164, campus#1007 (server ETag semantics).
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 0
- Merge trung bình
- 50 phút
- Pull request đã merge (30 ngày)
- 48
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nyjc-computing/campus-api-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
nyjc-computing/campus-api-python#19 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nyjc-computing/campus-api-python
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 73/100
-
day_or=True union silently becomes the ISC cron AND bug when a day field expands to its full range (e.g. '0 0 */1 * */2' fires only Sun/Tue/Thu/Sat)Có thể đã có người làm @rahul05ranjan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
pallets-eco/croniter#309 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
nyjc-computing/campus-admin#105 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/Gitcord-GithubDiscordBot#248 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày