-
Notifications
You must be signed in to change notification settings - Fork 120
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
Added typing / comments to the FilterInterface
and removed the token argument
#587
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.
@danielmorell Thank you for the thoughtful PR and design notes.
Adding $isUncaught
to the filter interface makes sense. I'm wondering though whether both interfaces are needed if they do the same thing. Or if either one can be improved to cover all the use cases of the other.
About the access token: I don't know how users of rollbar-php are using it, but in a multi-project runtime, it might be used to detect which project the message belongs to. Regardless, I agree $payload->getAccessToken()
should be sufficient.
@waltjones I appreciate you questioning the need for the two redundant filtering mechanisms. Having thought about it, I think we should keep them both for now. Let me first explain the difference between the two, and then I will explain why I think this. The
|
@danielmorell Thank you for the detailed reply. No apology needed. :) I think the reason for both the existence and the popularity of Thanks for the explanation on multi-project configurations. It sounds even more reasonable to remove the |
There are six interfaces for custom classes that may be passed into the configs to change how the Rollbar package works. They are:
DataBuilderInterface
handled in Added required public methods to theDataBuilderInterface
#586FilterInterface
handled in this PRResponseHandlerInterface
ScrubberInterface
SenderInterface
TransformerInterface
The others will be addressed in future PRs (coming soon).
Description of the change
Implementing the
FilterInterface
is the lesser used filtering alternative to thecheck_ignore
function.I removed the
$accessToken
argument from theFilterInterface::shouldSend()
method. This does not seem necessary, or helpful. And passing any sort of secret around where not needed seems like a poor idea. Additionally, if the implementation desperately needs it, calling$payload->getAccessToken()
will provide it from thePayload
instance.Design Question
The
check_ignore
function accepts a boolean$isUncaught
argument that is used to designate the log item as an uncaught error or exception.FilterInterface::shouldSend()
method could likely possibly benefit from this additional argument. Should I add it? Any input would be helpful.If we did not add the
$isUncaught
argument toFilterInterface::shouldSend()
, there is a simple workaround that would likely work...I appreciate any input on this question.
Type of change
Related issues
None
Checklists
Development
Code review