feat(json_client): headers param on JsonClient.get — If-None-Match → 304 conditional reads
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- backend-api-design
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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).
- Vorherrschende Sprache
- Python
- Sterne
- 0
- Forks
- 0
- Ø Merge
- 50 Min.
- Gemergte PRs (30 T.)
- 48
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus nyjc-computing/campus-api-python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
nyjc-computing/campus-api-python#19 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in nyjc-computing/campus-api-python
Ähnliche Issues
-
ui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
Maintainer antworten meist innerhalb von 1 Tag
-
CI: MSYS2 jobs fail — mingw python3 package renamed upstream to pythonEvtl. vergeben @ronaldtse hat das heute übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
pydantic/pytest-examples#102 · 1 Kommentar ·