Skip to content
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 idle time support #194

Merged
merged 1 commit into from
Sep 15, 2023
Merged

Add idle time support #194

merged 1 commit into from
Sep 15, 2023

Conversation

rundong08
Copy link
Collaborator

Fixes #179
Fixes #180

isIdle()
]).then((result) {
final currWindow = (result[0] as ProcessResult).stdout;
final idleState = result[1];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if the process crashes? Can result[1] ever cause an out of bounds access problem?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the process crashes, ProcessResult will still be generated with an non-zero exit code, the stdout will probably be empty or garbage but those were handled. If one of the Process.run throws an exception then the then body will not be executed and the error will be caught by the catchError below.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

isIdle()
]).then((result) {
final currWindow = (result[0] as ProcessResult).stdout.trim();
final idleState = result[1];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to get an out of bounds error here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@BobEvans
Copy link
Collaborator

Thanks! Looks great! Just a few small questions.

@BobEvans BobEvans merged commit 747eb96 into develop Sep 15, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create Idle Time logger for macos create Idle Time logger for linux
2 participants