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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Also note that
cnd_signal()
is not 1:1 withsignalCondition()
becausecnd_signal()
also adds a non-zero overhead call towithRestarts()
to add arlang_muffle
restart. Do we need that? If not, then at the very least we could just callsignalCondition()
directly to avoid that overhead fromcnd_signal()
even if we don't do this hackery.I have tracked the
rlang_muffle
thing back to this commit in rlangr-lib/rlang@2c1bd29
Ah okay, so "bare conditions" signaled with
signal()
orcnd_signal()
are mufflable byrlang::cnd_muffle()
due to the addition of thisrlang_muffle
restart, whilesignalCondition()
bare conditions are not. In other words thisrlang_muffle
restart helps bare conditions be more likewarning
andmessage
conditions, which are always mufflable due to havingmuffleWarning
andmuffleMessage
restarts available.On one hand that feels important to keep around, but on the other hand when would you ever want to muffle this kind of signal which doesn't have any side effects? (unlike messages and warnings that print something)
Here's what just switching
cnd_signal()
tosignalCondition()
would look like, which we can do without any hackery. We lose the ability to muffle alifecycle_signal
condition because there won't be arlang_muffle
restart around anymore, but maybe that is totally fine.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've opened #199 if we want to do this
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.
Other handlers might have side effects. We have never really used that restart AFAIK, so we can remove it: r-lib/rlang#1836