fix(asynccache): pass cached values to delete handlers - #269
Merged
PureWhiteWu merged 2 commits intoSep 18, 2026
Merged
PureWhiteWu merged 2 commits into
PureWhiteWu merged 2 commits into
Conversation
Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
Shubham-Padkonde
requested review from
PureWhiteWu and
zhangyunhao116
as code owners
September 17, 2026 21:42
PureWhiteWu
previously approved these changes
Sep 18, 2026
PureWhiteWu
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, thanks very much for the fix!
Collaborator
|
Please change your target branch to main |
Shubham-Padkonde
dismissed
PureWhiteWu’s stale review
September 18, 2026 04:22
The base branch was changed.
Contributor
Author
|
@PureWhiteWu Retargeted to main and updated the branch with the latest main. The diff is still just the two asynccache files. The base change auto-dismissed your earlier approval, so could you please re-approve? The required build check hasn't started yet, so if it needs maintainer approval to run, could you approve that too? Thanks! |
PureWhiteWu
approved these changes
Sep 18, 2026
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.
DeleteHandlercurrently receives the cache's private*entrywrapper. A handler expecting the stored value gets the wrong type, both when an entry expires and whenDeleteIfremoves it.Load the cached value before dispatching either asynchronous callback, and document the argument. Add six regression cases for strings, pointers, and nil values across both deletion paths. The tests also check that non-matching/touched entries remain and the first expiration pass does not delete an entry.
Fixes #248.
Validation:
go test -v -race -covermode=atomic ./...passes with Go 1.15.15, matching the CI Go series.go vet -stdmethods=false ./...and repository-widegofmt -schecks pass with Go 1.15.15.--new-from-rev=HEAD). Its full-repository defaults report 52 findings on unchanged code; these are not included in this callback fix.git diff --checkpasses.Assisted by Codex/GPT-6 for investigation, coding, and validation.