-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Watcher] Fix logic that determines watch error state #67952
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
Changes from 6 commits
46f2a01
8643782
0fad3e6
175045e
edcfd34
d1000b2
3d71644
82ec5ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,9 @@ export class ActionStatus { | |
| this.id = props.id; | ||
| this.actionStatusJson = props.actionStatusJson; | ||
| this.errors = props.errors; | ||
| this.lastCheckedRawFormat = props.lastCheckedRawFormat; | ||
|
|
||
| this.lastExecutionRawFormat = get(this.actionStatusJson, 'last_execution.timestamp'); | ||
| this.lastAcknowledged = getMoment(get(this.actionStatusJson, 'ack.timestamp')); | ||
| this.lastExecution = getMoment(get(this.actionStatusJson, 'last_execution.timestamp')); | ||
| this.lastExecutionSuccessful = get(this.actionStatusJson, 'last_execution.successful'); | ||
|
|
@@ -30,7 +32,10 @@ export class ActionStatus { | |
| const actionStatusJson = this.actionStatusJson; | ||
| const ackState = actionStatusJson.ack.state; | ||
|
|
||
| if (this.lastExecutionSuccessful === false) { | ||
| if ( | ||
| this.lastExecutionSuccessful === false && | ||
| this.lastCheckedRawFormat === this.lastExecutionRawFormat | ||
| ) { | ||
|
Comment on lines
+35
to
+38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From this it looks like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the watch only "executes" when the condition is met, but the watch condition is checked on a given interval. So the last time it was executed could be false, but the next time it is checked the condition may not be met so it doesn't execute. Does that make sense? I also tried to explain this in the PR description, but I'm probably not doing the best job so let me know if you need me to clarify more 😅 . |
||
| return ACTION_STATES.ERROR; | ||
| } | ||
|
|
||
|
|
||
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'm not 100% sure what this assignment is doing?
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.
Not sure what I was going for there either 😂 . Removed.