Repository navigation
Conversation
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44567 +/- ##
==========================================
- Coverage 90.26% 90.26% -0.01%
==========================================
Files 6452 6454 +2
Lines 407063 407068 +5
Branches 81800 81799 -1
==========================================
+ Hits 367450 367454 +4
- Misses 33210 33212 +2
+ Partials 6403 6402 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
asukaminato0721
left a comment
There was a problem hiding this comment.
2 inline suggestions at 6caaba5587, each from a rule learned from earlier reviews in this repository. Reply on a comment if it is wrong.
dify-codereview
asukaminato0721
left a comment
There was a problem hiding this comment.
CI is failing: Style Check / Python Style. Please fix it. 15 inline suggestions at 2e8dca1500, each from a rule learned from earlier reviews in this repository. Reply on a comment if it is wrong.
dify-codereview
asukaminato0721
left a comment
There was a problem hiding this comment.
Nothing to flag at 120993024b.
dify-codereview
Nothing left to flag at 1209930.
Summary
Part of #33092.
OAuth device state is currently decoded with
json.loadsand unpacked into a dataclass without validating its fields. A cachednull, array, or object missing required fields raises an exception outside the reader's corrupt-state handler; incorrectly typed fields and incomplete poll payloads can instead reach callers.Validate JSON with a cached Pydantic
TypeAdapterover the existingDeviceFlowStatedataclass, including its nestedPollPayload. Preserve the existing serialization and the reader's compatibility with legacy approval fields. Both read paths treat validation failures as unavailable state and log only the device identifier, avoiding validation messages that may contain plaintext tokens.This addresses one remaining JSON parsing boundary; it does not close the repository-wide migration issue.
Validation
git diff --checkpassed.6caaba5587546ffd3a06f46cee47b2dc5c55207e: 30 successful checks, 12 conditionally skipped, no failures or pending checks (2026-10-23). This includes Python Style, API unit/controller/integration tests, browser E2E, and Codecov.Local checks used Python 3.13 through
uv run --project api --no-syncwith the existing installed dependencies. The full repository lint/type suites and Docker integration tests were not run locally.Checklist
make lint && make type-checksuites.From Codex