Conversation
The server answers 200 {"ttl": null} for a live key with no expiry.
TtlResponse must keep decoding that to None; without a test, changing
the field to a bare u64 passes CI and turns every such key into a
client-side parse error. Also pins deny_unknown_fields.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. WalkthroughThe change adds unit coverage for ChangesTTL response tests
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Merge Risk: ⚪ Minimal · up to This PR adds focused TTL decoding coverage without changing production behavior, so it is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Summary
This PR adds a test to pin the JSON decoding behavior of
TtlResponsewhen the server returns attlfield with anullvalue (LAB-3593).Changes
Adds a new unit test
ttl_response_decodes_null_ttl_as_noneincrates/cachekit/src/backend/cachekitio_ttl.rsthat verifies three decoding scenarios:{"ttl": null}decodes successfully toNone(representing a live key with no expiry), rather than producing a parse error.{"ttl": 42}decodes successfully toSome(42).{"ttl": null, "extra": 1}produces an error, confirming that unexpected/extra fields are rejected.Purpose
The server responds with
{"ttl": null}for live keys that have no expiry set. This test locks in the expected behavior that such a response is treated as a validNonevalue and not misinterpreted as a decoding failure, guarding against future regressions inTtlResponsedeserialization.