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
Allow event monitoring to ignore failing event accessors #1954
base: develop
Are you sure you want to change the base?
Conversation
Moved methods config options to event monitor options
Pull Request Test Coverage Report for Build 2823614045Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
Fixed wrong Timestamp
Removed unused moq
Btw, I'm AFK for a week from today. I'll continue reviewing once I'm back. |
Hi, Quick question: I did changes on my fork and pushed it. Sadly github does not seem to detect them in this PR. Do you know how I can update the PR? |
Ah ok... odd. This did not show up, that's why I was a bit confused (hadn't used github in some time...) |
Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
And API-checks.. |
@apazureck any change you will finish this PR? |
Would this go into 6.12 if someone finishes it? |
Hi, I will fix the stuff until Friday. Thought it was OK and already finished. |
# Conflicts: # docs/_pages/releases.md
# Conflicts: # docs/_pages/releases.md
Qodana for .NETIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
Co-authored-by: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com>
Can you also take care of the remaining qodana issues? |
Hi, Yes, I am on it. But the job took so long to run I went to bed yesterday. |
Updated descriptions to match current the actual behavior
public event EventHandler RemoveFailingEvent; | ||
} | ||
|
||
[SuppressMessage("Usage", "CA1801:Check Unused Parameter", Justification = "This is on purpose for testing.")] |
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.
What parameter is unused?
I didn't get a warning when removing this.
@@ -7,31 +7,13 @@ sidebar: | |||
nav: "sidebar" | |||
--- | |||
|
|||
## 7.0 Alpha 1 |
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.
Something went wrong here 🙃
public static IMonitor<T> Monitor<T>(this T eventSource, Func<DateTime> utcNow = null) | ||
{ | ||
return new EventMonitor<T>(eventSource, utcNow ?? (() => DateTime.UtcNow)); | ||
var options = new EventMonitorOptions(); | ||
|
||
if (utcNow is not null) | ||
{ | ||
options.ConfigureTimestampProvider(utcNow); | ||
} | ||
|
||
return new EventMonitor<T>(eventSource, options); | ||
} |
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.
Now that we're open to change the existing API, we could remove Func<DateTime> utcNow = null
, such that this becomes.
public static IMonitor<T> Monitor<T>(this T eventSource) =>
new EventMonitor<T>(eventSource, new EventMonitorOptions());
For testing we still have the internal ConfigureTimestampProvider
.
@dennisdoomen What do you think?
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.
For testing we still have the internal
ConfigureTimestampProvider
.
What's that?
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.
EventMonitorOptions.ConfigureTimestampProvider
.
In #625 the Func<DateTime> utcNow = null
was added, but I suspect it wasn't meant for public use, but merely a necessity for testing.
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 yes, you're right. That would no longer be necessary.
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.
Do you have a workflow for obsolete methods? Should it be tagged obsolete first with the remark it will be removed in the next version? Then people have some time, if they are using it for some reason.
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.
Yes, that's how we normally do it. But last week, the develop
branch is used for the next major version, so we're fine to introduce well-argumented breaking changes in that branch.
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 removed the utcnow. I handed down the options to the eventrecorder, as otherwise the late changed reference on the timestamp provider would not be used. The events are subscribed when the constructor is called. Please check if it is conform to your other code and let me know, if it you like another approach.
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.
In #625 the Func utcNow = null was added, but I suspect it wasn't meant for public use, but merely a necessity for testing.
We should mention this in the docs as well :)
Co-authored-by: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com>
You'll need to rebase your changes on |
Ping |
Thanks for the reminder, I thought it was already finished. I can tend to this on the upcoming weekend and hope it will pass then. |
Pong |
@apazureck Do you have a plan on finishing this? |
Added options to event monitor and added option to suprress exceptions on event accessors.
Closes #1948
IMPORTANT