LEGLINK-908: Avoid cache key collisions in Validation - #1840
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesValidation cache keys
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change makes validation cache keys specific to their input tuple and adds unit coverage; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🛠️ Description of Changes
Objects.hash returns a 32-bit int, so the key space is 2^32. Two different (codeSystem, code, display, valueSetUrl) tuples that hash to the same value share a cache entry, and the second lookup silently receives the first tuple's CodeValidationResult.
This PR replaces the hash with a delimiter-joined string key (codeSystem|code|display|valueSetUrl).
🧪 Testing Performed
Configured validation for remote terminology lookup and ran automated tests.
🧑🔬 Unit Testing
📓 Documentation Updated
N/A
Summary by CodeRabbit