fix: Prevent mutation of cached feature resolution results - #6722
fix: Prevent mutation of cached feature resolution results#6722junwoo-choi-rapportlabs wants to merge 1 commit into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6722 +/- ##
=======================================
Coverage 46.79% 46.79%
=======================================
Files 415 415
Lines 50395 50396 +1
Branches 7215 7215
=======================================
+ Hits 23581 23584 +3
+ Misses 25162 25161 -1
+ Partials 1652 1651 -1
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
jyejare
left a comment
There was a problem hiding this comment.
This PR fixes a caching bug where mutations to feature lists were leaking between cached requests. The fix creates defensive copies of grouped_refs to prevent shared mutable state issues. The implementation is correct and includes comprehensive test coverage.
|
The DCO warning needs to be handled. please check the warning message. |
194555c to
fe50efc
Compare
Copy grouped feature lists before passing them to online stores so Redis timestamp fields do not accumulate in the shared resolution cache. Signed-off-by: rapportlabs <junwoo@rapportlabs.kr>
fe50efc to
728daea
Compare
My bad. corrected it. |
What this PR does / why we need it:
_get_cached_request_context()cachesgrouped_refs, including the mutablerequested-feature lists nested inside it.
The Redis online store appends an internal timestamp key to these lists while
preparing HMGET fields. Because cache hits returned the same nested lists,
timestamp keys could accumulate across requests, increasing Redis fields and
response post-processing work over time.
This change copies each requested-feature list at the request preparation
boundary before passing it to an online store. The cached resolution remains
shared, while downstream mutations become request-local.
Which issue(s) this PR fixes:
N/A
Checks
git commit -s)Testing Strategy