Repository navigation
Conversation
Contributor
|
Thank you @banghamid for spotting this and submitting a clean fix! Review Summary: Approve
Optional suggestion (nitpick / non-blocking)Both $this->assertSame(135, $this->handler->decrement('counter', 20));
$this->assertSame(135, $this->handler->get('counter')); |
gr8man
approved these changes
Nov 11, 2026
Contributor
Author
|
thanks @gr8man! good catch, makes sense to check the return value directly too. just pushed an update to testIncrementAndDecrement() to assert the returned int from increment() and decrement() as well. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PredisHandler::save()andPredisHandler::get()store and read cached values in a Redis hash using the'__ci_type'and'__ci_value'fields. However,PredisHandler::increment()andPredisHandler::decrement()were still callinghincrby()on the legacy'data'field instead of'__ci_value'.As a result, calling
increment()ordecrement()modified the unused'data'hash field while leaving'__ci_value'unchanged, causing subsequent calls toget()to return the stale value.This PR:
PredisHandler::increment()andPredisHandler::decrement()to target the'__ci_value'hash field (consistent withRedisHandler::increment()).testIncrementAndDecrement()toPredisHandlerTest.Checklist: