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.
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
Split the with_deferred_parent_expiration and with_deferred_parent_expiration #578
Split the with_deferred_parent_expiration and with_deferred_parent_expiration #578
Changes from all commits
e4779b2
60eb5c9
5e52e4a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should raise, not just emit a deprecation. The two are not compatible right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just always emit this deprecation. It shouldn't be blocked by the deferred expiration flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just a warning, so will not block. We don't want to raise errors here, because we want the two methods are compatible.
The
with_deferred_expiration
has already coveredwith_deferred_parent_expiration
.parent
deferred expiration: supported by both.child
deferred expiration: only supported bywith_deferred_parent_expiration
.attribute
deferred expiration: only supported bywith_deferred_parent_expiration
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two methods can be nested and used together as they are compatible. We don't need to raise and fail if they are used together. The warning here is just to cover the case in this unit test: https://github.com/Shopify/identity_cache/pull/578/files#diff-a5e1bbc9f7c7519a1e9bd0e04064c349f39bf6a6a4d029651461b87ef81dde1eR258-R290
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are two separate things here.
Regarding the incompatibility, I had the same concern, @grcooper. @drinkbeer and I paired on it and the nesting should be compatible, as also evidenced by the tests.
If there is a scenario we are concerned about we should write a test for it.
However, I think we should just be deprecating the use of this method in all cases (rather than the gated warning) as we want to progress to a V2 where we remove this method and just have people use
.with_deferred_expiration
.So:
.with_deferred_parent_expiration
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, I was thinking that they were not compatible. It looks like that test proves that they are compatible though and are not duplicating work 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we deprecating here? Shouldn't we raise if they are both used? Ie with a nested deffered exception?