-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add policy event #4219
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
Add policy event #4219
Conversation
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.
LGTM
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 is great. But there is one issue, which is that the policy
event will also be emitted for server method caching.
Ie. either the docs need to be revised, or the implementation made to match the docs. I don't have an opinion on which approach will be better, so I hope you can offer which will work best for you. If you go with both, you could emit them on separate channels to differentiate it.
I would also like to note that adding a built-in event is potentially a breaking change since That being said, this is a rarely used feature so a conflict is unlikely and if it does occur, it would most likely result in a very obvious error during server instantiation. As such, I would probably allow it without a major revision bump. |
How would you go about differenciating them @kanongil in case you had something in mind? |
a6efb6f
to
500d0b5
Compare
Documentation updated. I am not sure how useful is to emit the event on separate channels though. As long as there is a policy involved, it wouldn't matter much how was it created. 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.
Great. If you don't need to distinguish them, then we can leave it as is. Channels / tags can always be added later when needed.
Only missing a test for triggering the policy
event for a cached server method now.
Tests for cached server methods added. CI failures seem unrelated to these changes. |
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.
Looks good 👍 I re-ran the tests, noting the flaky failures for further inspection, and everything is passing. Thanks for the careful work on this, everyone. I know several folks were following along who were not actively commenting on the related issues, self included.
Apologies for the late thought and potential request, but how do folks feel about changing the event name to |
I agree with your points, and had a similar idea for the name. I settled on Given that this will be a rarely used event, |
I agree with both of you. Renaming it is a good idea. |
Agreed. Changes applied. |
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.
Beautiful. Thanks for all the careful work @jonathansamines 🙏
A event based approach to solve #4104 as suggested in #4210