-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapping does not work #56
Comments
@srgl I see what you are saying. In that commit, I changed the default self.isCacheableValue = args.isCacheableValue || function(value) {
return value !== null && value !== undefined;
}; to this: self.isCacheableValue = args.isCacheableValue || function(value) {
return value !== undefined;
};
However, something is strange, because the default if (typeof args.isCacheableValue === 'function') {
self._isCacheableValue = args.isCacheableValue;
} else if (typeof self.store.isCacheableValue === 'function') {
self._isCacheableValue = self.store.isCacheableValue;
} else {
self._isCacheableValue = function(value) {
return value !== undefined;
};
} The default implementation only tests for We can always revert to testing for I would like some input from @PuKoren, @mrister, and @jkernech on this, too. It's definitely a problem in |
Ok, just looking through the issues and PRs at jaredwray/cacheable#25 Somebody suggested having separate jaredwray/cacheable#41 So, the question is, what is the best way to deal with this now? We either:
Choose your poison. Which do we think is best? EDIT: The more I think about it, since Also, option 1 (the way it is in |
@jeff-kilbride Simple logic: as the redis adapter returns |
This is a difficult decision, as I personally think null is a valid cache value in application (and indeed not in redis). What do you think of checking if key exists in cases where redis returns What do you think about it? |
Indeed a difficult decision. We must take into account our current behaviour regardless of |
Since I use However, the change in Let me know what you want to do and I can submit a PR. |
If there is a breaking change, it should be tagged as major About the change for I'm fine with reverting, but we should think about something because this means that users that wants to store |
Yeah, people are already having issues. See #57. I only called it a "breaking change" because I changed the default If we revert, it shouldn't affect anyone that has already redefined |
People redefining @jeff-kilbride: would you like to be added to the contributors of this project? Your insights are helpful and you are an active contributor, it will allow you to work directly on this project branches |
I see what you're saying. I guess I'm more concerned with people using the default version, which is now broken without any warning. |
You are right. Do we all agree to revert and re-release (with zlib, as Edit: wut, 3 messages in 3 seconds 👍 Below: yes, we can release zlib IMO. Ok to revert the commit on 0.2.5 and release as 0.2.6, and release develop on 0.3.0? |
I basically have this reverted in a new branch, but I just noticed that you merged the compression stuff into |
@jeff-kilbride agree. Spent three hours investigating why wrapped function start to return null value :) |
If we revert, I think it should be What do you think? |
Yep, totally agree with 2 releases |
@PuKoren I merged my upstream |
Here is what I have:
|
@jeff-kilbride forgot to push it, should be fine now, sorry about that! |
Ok, I have reverted |
Thanks @jeff-kilbride, we merged it and published it in 0.2.6 and above |
It looks like the 8701d62 has broken the wrapping functionality. Redis adapter returns null in case there is no specified key, as a result
.wrap
doesn't call workload and always returnnull
.As a workaround, there is the
isCacheableValue
option.The text was updated successfully, but these errors were encountered: